react-simple-game-engine 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,8 @@
1
1
  import { AnimationInitialParams } from "../../export-types";
2
2
  export declare abstract class AnimationSprite {
3
+ onCompletedCycle?: (info: {
4
+ timeCounter: number;
5
+ }) => void;
3
6
  protected currentFrame: number;
4
7
  protected _isRunning: boolean;
5
8
  protected timeCounter: number;
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/classes/animations/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,8BAAsB,eAAe;IACnC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAK;IACnC,SAAS,CAAC,UAAU,UAAQ;IAC5B,SAAS,CAAC,WAAW,SAAK;IAE1B,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,YAAY,CAAK;IAEzB,IAAI,SAAS,IAIa,OAAO,CAFhC;IAED,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,EAQhC;IAED,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAEtD,IAAI;IAwBJ,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,OAAO;IAC3C,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI;CAClC"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/classes/animations/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,8BAAsB,eAAe;IACnC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAE3D,SAAS,CAAC,YAAY,EAAE,MAAM,CAAK;IACnC,SAAS,CAAC,UAAU,UAAQ;IAC5B,SAAS,CAAC,WAAW,SAAK;IAE1B,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,YAAY,CAAK;IAEzB,IAAI,SAAS,IAIa,OAAO,CAFhC;IAED,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,EAQhC;IAED,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAEtD,IAAI;IAyBJ,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,OAAO;IAC3C,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI;CAClC"}
@@ -24,6 +24,7 @@ var AnimationSprite = /** @class */ (function () {
24
24
  configurable: true
25
25
  });
26
26
  AnimationSprite.prototype.draw = function () {
27
+ var _a;
27
28
  if (this.checkFrameMax()) {
28
29
  this.currentFrame = 0;
29
30
  this.cycleCounter++;
@@ -32,6 +33,7 @@ var AnimationSprite = /** @class */ (function () {
32
33
  // if max cycle = 0, then don't care about counter, just infinite
33
34
  if (this.maxCycle) {
34
35
  if (this.cycleCounter > this.maxCycle) {
36
+ (_a = this.onCompletedCycle) === null || _a === void 0 ? void 0 : _a.call(this, { timeCounter: this.timeCounter });
35
37
  this.isRunning = false;
36
38
  }
37
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-game-engine",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",