pixi-rainman-game-engine 0.3.44-beta → 0.3.45

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.
@@ -320,7 +320,6 @@ export declare abstract class AbstractMainContainer extends Container {
320
320
  * @returns {Promise<void>} - A promise that resolves when the gamble game is finished.
321
321
  */
322
322
  invokeGambleGame(): Promise<void>;
323
- private destroyDisplayContainer;
324
323
  /**
325
324
  * Function for creating the under frame panel.
326
325
  * This panel is used in mobile portrait mode to display additional information.
@@ -243,7 +243,7 @@ export class AbstractMainContainer extends Container {
243
243
  await this._freeSpinPlate.onStart();
244
244
  });
245
245
  if (this._freeSpinPlate !== null) {
246
- this.destroyDisplayContainer(this._freeSpinPlate);
246
+ this.removeChild(this._freeSpinPlate);
247
247
  this._freeSpinPlate = null;
248
248
  }
249
249
  this.hideOverlay();
@@ -304,7 +304,7 @@ export class AbstractMainContainer extends Container {
304
304
  this.addChild(this._freeSpinSummary);
305
305
  });
306
306
  if (this._freeSpinSummary !== null) {
307
- this.destroyDisplayContainer(this._freeSpinSummary);
307
+ this.removeChild(this._freeSpinSummary);
308
308
  this._freeSpinSummary = null;
309
309
  }
310
310
  this.hideOverlay();
@@ -321,7 +321,7 @@ export class AbstractMainContainer extends Container {
321
321
  return;
322
322
  }
323
323
  this.freeSpinSummary.onClick();
324
- this.destroyDisplayContainer(this.freeSpinSummary);
324
+ this.removeChild(this.freeSpinSummary);
325
325
  this._freeSpinSummary = null;
326
326
  this.hideOverlay();
327
327
  }
@@ -571,7 +571,7 @@ export class AbstractMainContainer extends Container {
571
571
  this.addChild(this.gambleGame);
572
572
  });
573
573
  if (this.gambleGame) {
574
- this.destroyDisplayContainer(this.gambleGame);
574
+ this.removeChild(this.gambleGame);
575
575
  this.messageBox.visible = true;
576
576
  RainMan.settingsStore.isGambleGameActive = false;
577
577
  this._controller.updateGambleValues(RainMan.settingsStore.gambleGameWin);
@@ -583,15 +583,6 @@ export class AbstractMainContainer extends Container {
583
583
  }
584
584
  this.hideOverlay();
585
585
  }
586
- destroyDisplayContainer(container) {
587
- if (container.destroyed) {
588
- return;
589
- }
590
- if (container.parent) {
591
- container.parent.removeChild(container);
592
- }
593
- container.destroy({ children: true });
594
- }
595
586
  /**
596
587
  * Function for creating the under frame panel.
597
588
  * This panel is used in mobile portrait mode to display additional information.
@@ -50,7 +50,7 @@ export class MiddleButtons extends ResponsiveContainer {
50
50
  this.refreshButton.anchor.set(0.5, 0.5);
51
51
  this.autoplayButton.anchor.set(0.5, -1);
52
52
  this.takeButton.anchor.set(0.5, 2);
53
- this.gambleButton.anchor.set(0.5, -1);
53
+ this.gambleButton.anchor.set(0.5, -1.22);
54
54
  }
55
55
  else {
56
56
  this.autoplayButton.anchor.set(2, 0.5);
@@ -68,16 +68,7 @@ export class AnimatedNumber extends Container {
68
68
  * @returns {void}
69
69
  */
70
70
  removeDigits() {
71
- this.digits.forEach((digit) => {
72
- if (digit.destroyed) {
73
- return;
74
- }
75
- digit.state.clearListeners();
76
- if (digit.parent) {
77
- digit.parent.removeChild(digit);
78
- }
79
- digit.destroy({ children: true });
80
- });
71
+ this.digits.forEach((digit) => this.removeChild(digit));
81
72
  this.digits = [];
82
73
  }
83
74
  /**
@@ -91,7 +91,6 @@ export declare abstract class AbstractSymbolBase extends Container implements Sp
91
91
  * @returns {Promise<void>}
92
92
  */
93
93
  handleMultiplierAnimation(multiplier: number): Promise<void>;
94
- private destroySpine;
95
94
  /**
96
95
  * Function for playing the symbol animation
97
96
  * @public
@@ -31,10 +31,10 @@ export class AbstractSymbolBase extends Container {
31
31
  this._id = symbolId;
32
32
  this.spine = new Spine(this.getResourceForSymbolId(this._id));
33
33
  this.spine.parentLayer = AnimationLayer;
34
- this.spine.x = 0;
35
- this.spine.y = 0;
36
34
  this.symbolImage = new Sprite(getTexture(this.getImage(this._id)));
37
35
  this.setSymbol(symbolId);
36
+ this.spine.x = 0;
37
+ this.spine.y = 0;
38
38
  this.eventMode = "static";
39
39
  const symbolRadius = 150;
40
40
  this.hitArea = new Rectangle(-symbolRadius, -symbolRadius, 2 * symbolRadius, 2 * symbolRadius);
@@ -109,7 +109,6 @@ export class AbstractSymbolBase extends Container {
109
109
  return () => {
110
110
  this.swapSymbol(symbolId);
111
111
  return new Promise((resolve) => {
112
- this.destroySpine(this.spine);
113
112
  this.spine = new Spine(getSpineData(specialResourceName));
114
113
  this.endOfSwapAnimationPromise = resolve;
115
114
  switch (this.animationSpeedMultiplier) {
@@ -144,11 +143,10 @@ export class AbstractSymbolBase extends Container {
144
143
  */
145
144
  switchSymbolBaseDisplayedObject(option, suffix = "") {
146
145
  if (option === "spine") {
147
- const { x, y } = this.symbolImage;
148
- this.destroySpine(this.spine);
146
+ this.removeChild(this.spine);
147
+ this.spine.x = this.symbolImage.x;
148
+ this.spine.y = this.symbolImage.y;
149
149
  this.spine = new Spine(this.getResourceForSymbolId(this._id));
150
- this.spine.x = x;
151
- this.spine.y = y;
152
150
  const animationName = this.getAnimationNameForSymbol(this._id, suffix);
153
151
  this.spine.parentLayer = AnimationLayer;
154
152
  this.spine.state.setAnimation(0, animationName, false);
@@ -158,15 +156,14 @@ export class AbstractSymbolBase extends Container {
158
156
  this.removeChild(this.symbolImage);
159
157
  return;
160
158
  }
161
- const { x, y } = this.symbolImage;
162
159
  this.removeChild(this.symbolImage);
163
160
  this.symbolImage.destroy({ children: true });
164
161
  this.symbolImage = new Sprite(getTexture(this.getImage(this._id, suffix)));
165
162
  this.symbolImage.anchor.set(0.5, 0.5);
166
- this.symbolImage.x = this.spine.destroyed ? x : this.spine.x;
167
- this.symbolImage.y = this.spine.destroyed ? y : this.spine.y;
163
+ this.symbolImage.x = this.spine.x;
164
+ this.symbolImage.y = this.spine.y;
168
165
  this.addChild(this.symbolImage);
169
- this.destroySpine(this.spine);
166
+ this.removeChild(this.spine);
170
167
  return;
171
168
  }
172
169
  /**
@@ -185,7 +182,6 @@ export class AbstractSymbolBase extends Container {
185
182
  }
186
183
  else {
187
184
  logError(`$ Multiplier animation 'x${multiplier}' does not exist for symbol ID: ${this._id}`);
188
- symbolMultiplier.destroy({ children: true });
189
185
  return;
190
186
  }
191
187
  this.addChild(symbolMultiplier);
@@ -198,17 +194,6 @@ export class AbstractSymbolBase extends Container {
198
194
  });
199
195
  });
200
196
  this.removeChild(symbolMultiplier);
201
- symbolMultiplier.destroy({ children: true });
202
- }
203
- destroySpine(spine) {
204
- if (spine.destroyed) {
205
- return;
206
- }
207
- spine.state.clearListeners();
208
- if (spine.parent) {
209
- spine.parent.removeChild(spine);
210
- }
211
- spine.destroy({ children: true });
212
197
  }
213
198
  /**
214
199
  * Function for playing the symbol animation
@@ -68,6 +68,7 @@ export class UpdatableValueComponent extends Container {
68
68
  }
69
69
  }
70
70
  async update(newValue, time = RainMan.config.durationOfActions.updatableTextCountingDuration) {
71
+ this.tween?.stop();
71
72
  this.finalValue = newValue;
72
73
  Ticker.shared.remove(this.animateTick);
73
74
  Ticker.shared.add(this.animateTick);
@@ -80,6 +81,7 @@ export class UpdatableValueComponent extends Container {
80
81
  * @returns {Promise<void>} A promise that resolves when the update is complete.
81
82
  */
82
83
  async loseUpdate(time = RainMan.config.durationOfActions.updatableTextCountingDuration) {
84
+ this.tween?.stop();
83
85
  Ticker.shared.remove(this.animateTick);
84
86
  Ticker.shared.add(this.animateTick);
85
87
  await this.initAnimation(0, time / this.countingDivider, true);
@@ -170,35 +170,33 @@ export class AbstractController {
170
170
  */
171
171
  setupSpaceOrEnterListener() {
172
172
  window.addEventListener("keydown", (keyboardEvent) => {
173
- if (keyboardEvent.code === "Space" || keyboardEvent.code === "Enter") {
174
- keyboardEvent.preventDefault();
175
- if (this.buttonHeldSince === 0) {
176
- this.buttonHeldSince = Date.now();
177
- }
178
- const buttonHold = Date.now() - this.buttonHeldSince;
179
- if (buttonHold >= 500) {
180
- this.columnsContainer.enableQuickReelsStop();
181
- }
182
- if (RainMan.settingsStore.isGambleGameActive || RainMan.settingsStore.isSpeedModalShown) {
183
- return;
184
- }
185
- if (RainMan.settingsStore.disableKeyboardShortcuts) {
186
- return;
187
- }
188
- this.handleDisablingButtons(true);
189
- this.handleSpinLogic();
173
+ if (keyboardEvent.code !== "Space" && keyboardEvent.code !== "Enter") {
174
+ return;
175
+ }
176
+ keyboardEvent.preventDefault();
177
+ if (this.buttonHeldSince === 0) {
178
+ this.buttonHeldSince = Date.now();
179
+ }
180
+ const buttonHold = Date.now() - this.buttonHeldSince;
181
+ if (buttonHold >= 500) {
182
+ this.columnsContainer.enableQuickReelsStop();
183
+ }
184
+ if (RainMan.settingsStore.isGambleGameActive || RainMan.settingsStore.isSpeedModalShown) {
185
+ return;
186
+ }
187
+ if (RainMan.settingsStore.disableKeyboardShortcuts) {
188
+ return;
190
189
  }
190
+ this.handleDisablingButtons(true);
191
+ this.handleSpinLogic();
191
192
  });
192
193
  window.addEventListener("keyup", (keyboardEvent) => {
193
- if (keyboardEvent.code === "Space" || keyboardEvent.code === "Enter") {
194
- keyboardEvent.preventDefault();
195
- this.buttonHeldSince = 0;
196
- this.columnsContainer.clearQuickReelsStop();
197
- if (this.gamePhase === gamePhases.HANDLING_ACTIONS ||
198
- this.gamePhase === gamePhases.STOPPING_HANDLING_ACTIONS) {
199
- this.shouldPlayNextSpin = false;
200
- }
194
+ if (keyboardEvent.code !== "Space" && keyboardEvent.code !== "Enter") {
195
+ return;
201
196
  }
197
+ keyboardEvent.preventDefault();
198
+ this.buttonHeldSince = 0;
199
+ this.columnsContainer.clearQuickReelsStop();
202
200
  });
203
201
  window.addEventListener("blur", () => {
204
202
  this.buttonHeldSince = 0;
@@ -149,6 +149,7 @@ export declare class UiController {
149
149
  updateShownPossibleWin(): void;
150
150
  /**
151
151
  * Shows game pays in a bottom panel, if exists
152
+ * @param amount
152
153
  * @public
153
154
  * @returns {void}
154
155
  */
@@ -220,6 +220,7 @@ export class UiController {
220
220
  }
221
221
  /**
222
222
  * Shows game pays in a bottom panel, if exists
223
+ * @param amount
223
224
  * @public
224
225
  * @returns {void}
225
226
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.3.44-beta",
3
+ "version": "0.3.45",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",