find a way to sharing init

+ vector.normalized()
+ misc
This commit is contained in:
LuckyLaszlo
2022-11-28 04:33:27 +01:00
parent 4aafbac1a5
commit 7f248b5449
10 changed files with 45 additions and 65 deletions

View File

@@ -80,10 +80,10 @@ class BallClient extends Ball implements GraphicComponent {
color: string;
update: () => void;
clear: (pos?: VectorInteger) => void;
constructor(pos: VectorInteger, size: number, baseSpeed: number,
constructor(pos: VectorInteger, size: number, baseSpeed: number, speedIncrease: number,
ctx: CanvasRenderingContext2D, color: string)
{
super(pos, size, baseSpeed);
super(pos, size, baseSpeed, speedIncrease);
this.ctx = ctx;
this.color = color;
this.update = updateRectangle;