reafactoring

This commit is contained in:
LuckyLaszlo
2022-11-17 12:22:57 +01:00
parent 6fb1470dbb
commit 023b5ed485
5 changed files with 61 additions and 52 deletions

View File

@@ -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;
} */