From 6c37585ef4ef2535aff8c45c64850be0a6c26eab Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Thu, 2 Jun 2022 08:54:02 +0200 Subject: Death animations --- src/Drawable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Drawable.ts') diff --git a/src/Drawable.ts b/src/Drawable.ts index 9ed9a2a..375d515 100644 --- a/src/Drawable.ts +++ b/src/Drawable.ts @@ -73,7 +73,7 @@ export default abstract class Drawable { if (val <= 15 + 24) this._y = 15 + 24; // else if (val + this.height >= canvas.height - 15) this._y = canvas.height - 15 - this.height + diff; else if (val + this.height >= canvas.height - 15) { - if (left || right) return + if (left || right) this._y = canvas.height - 15 - this.height + diff + 1; else this._y = canvas.height - 15 - this.height + diff; } else this._y = val @@ -90,6 +90,7 @@ export default abstract class Drawable { } export class Rectangle extends Drawable { + sprite = "rgba(128,0,128, 0.5)" constructor(public begetter: Drawable, x?: number, y?: number, width?: number, height?: number) { if (begetter.width === PLAYER_SIZE) { console.log(begetter.x, begetter.y, begetter.width, begetter.height); @@ -111,7 +112,6 @@ export class Rectangle extends Drawable { set y(val) { this._y = val } get x2() { return this.x + this.width } get y2() { return this.y + this.height } - sprite = "rgba(128,0,128, 0.5)" } // export abstract class Square { // constructor(public x: number, public y: number, public width: number, public height: number) { } -- cgit v1.3.1