reafactoring
This commit is contained in:
@@ -155,3 +155,18 @@ class Line extends Rectangle {
|
||||
}
|
||||
|
||||
export {Rectangle, MovingRectangle, Player, Ball, Line}
|
||||
|
||||
// How to handle const export in initGame ?
|
||||
// example for class Rectangle
|
||||
/* constructor(ctx?: CanvasRenderingContext2D, pos?: VectorInteger, color?: string, width?: number, height?: number) {
|
||||
if (ctx && pos && color && width && height)
|
||||
this.init(ctx, pos, color, width, height);
|
||||
}
|
||||
// constructor() {}
|
||||
init(ctx: CanvasRenderingContext2D, pos: VectorInteger, color: string, width: number, height: number) {
|
||||
this.ctx = ctx;
|
||||
this.pos = Object.assign({}, pos);
|
||||
this.color = color;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
} */
|
||||
|
||||
Reference in New Issue
Block a user