From b4defa324a330217f0139f1240bcf53c0b1f996a Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Thu, 2 Jun 2022 23:13:07 +0200 Subject: v1.0.0 --- src/Animation.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Animation.ts') diff --git a/src/Animation.ts b/src/Animation.ts index 968a57d..9d49ec7 100644 --- a/src/Animation.ts +++ b/src/Animation.ts @@ -4,6 +4,7 @@ import Drawable from "./Drawable"; export default class Anime extends Drawable { i = 0; j = 0; + cb: any | null; constructor(public drawable: Drawable, public frames: Array) { super(drawable._x, drawable._y) @@ -24,6 +25,7 @@ export default class Anime extends Drawable { } catch (e) { debugger } } if (++this.j === 5) { this.i++; this.j = 0; } + if (this.i === this.frames.length && this.cb) this.cb() return this.i !== this.frames.length; } } -- cgit v1.3.1