pixi-rainman-game-engine 0.2.8 → 0.2.10

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.
@@ -325,11 +325,13 @@ export class AbstractMainContainer extends Container {
325
325
  return;
326
326
  const newBalance = await new Promise((resolve) => {
327
327
  this.gambleGame = new GambleGame(this.gambleGameSpineName, resolve, this._controller.lastWinAmount, this._controller.balance);
328
+ RainMan.settingsStore.isGambleGameActive = true;
328
329
  this.showOverlay();
329
330
  this.addChild(this.gambleGame);
330
331
  });
331
332
  if (this.gambleGame) {
332
333
  this.removeChild(this.gambleGame);
334
+ RainMan.settingsStore.isGambleGameActive = false;
333
335
  this._controller.updateGambleValues(RainMan.settingsStore.gambleGameWin);
334
336
  this.gambleGame = null;
335
337
  }
@@ -156,7 +156,7 @@ export class GambleGame extends Container {
156
156
  this.card.y = height / 2;
157
157
  this.collectText.x = CENTER;
158
158
  this.collectText.y = height - this.collectText.height;
159
- this.collectButton.scale.set(globalMinRatio() * 0.8);
159
+ this.collectButton.scale.set(globalMinRatio() * 0.6);
160
160
  this.collectButton.x = CENTER;
161
161
  this.collectButton.y = this.collectText.y - this.collectButton.height - 30;
162
162
  this.redButton.scale.set(globalMinRatio() * COLOR_BUTTONS_SCALE_X);
@@ -48,6 +48,7 @@ export declare abstract class AbstractController<T> {
48
48
  protected skipFreeSpinSummary: boolean;
49
49
  protected scatterCountForFx: number;
50
50
  protected summaryStop: boolean;
51
+ protected shouldDisableBetButtons: boolean;
51
52
  protected _lastWinAmount: number;
52
53
  protected constructor(buttonsEventManager: ButtonsEventManager, mainContainer: AbstractMainContainer, connection: SubscribableConnectionWrapper);
53
54
  init(): void;
@@ -154,7 +155,7 @@ export declare abstract class AbstractController<T> {
154
155
  protected canSkipActions(): boolean;
155
156
  protected onSpinningStart(): Promise<void>;
156
157
  protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
157
- protected performActionsAfterSpin(): void;
158
+ protected performActionsAfterSpin(): Promise<void>;
158
159
  protected gambleGameEnabler(winAmount: number): void;
159
160
  /**
160
161
  * Function for spin logic of the game
@@ -47,6 +47,7 @@ export class AbstractController {
47
47
  skipFreeSpinSummary = false;
48
48
  scatterCountForFx = 2;
49
49
  summaryStop = false;
50
+ shouldDisableBetButtons = false;
50
51
  _lastWinAmount = 0;
51
52
  constructor(buttonsEventManager, mainContainer, connection) {
52
53
  this.buttonsEventManager = buttonsEventManager;
@@ -115,6 +116,9 @@ export class AbstractController {
115
116
  window.addEventListener("keydown", (keyboardEvent) => {
116
117
  if (keyboardEvent.code === "Space" || keyboardEvent.code === "Enter") {
117
118
  keyboardEvent.preventDefault();
119
+ if (RainMan.settingsStore.isGambleGameActive) {
120
+ return;
121
+ }
118
122
  this.handleDisablingButtons(true);
119
123
  this.handleSpinLogic();
120
124
  }
@@ -375,7 +379,7 @@ export class AbstractController {
375
379
  performance.now() - this.mainContainer.freeSpinSummary.shownAt <
376
380
  RainMan.config.durationOfActions.freeSpinSummaryVisibleTime)
377
381
  return;
378
- this.mainContainer.hideFreeSpinSummary();
382
+ this.mainContainer.freeSpinSummary.emit("pointerdown", new PIXI.FederatedPointerEvent("pointerdown"));
379
383
  return;
380
384
  }
381
385
  if (this.mainContainer.mysteryWinVisibleFor) {
@@ -547,7 +551,7 @@ export class AbstractController {
547
551
  }
548
552
  async onSpinningStart() { }
549
553
  async onSpinningEnd(_spinLogic) { }
550
- performActionsAfterSpin() { }
554
+ async performActionsAfterSpin() { }
551
555
  gambleGameEnabler(winAmount) {
552
556
  if (RainMan.componentRegistry.has(BUTTONS.gamble) && !RainMan.settingsStore.gambleGameUsed) {
553
557
  RainMan.componentRegistry
@@ -690,7 +694,7 @@ export class AbstractController {
690
694
  RainMan.settingsStore.setRoundNumber(this.roundNumber);
691
695
  this.handleDisablingButtons();
692
696
  RainMan.settingsStore.setModalsAvailability(true);
693
- this.performActionsAfterSpin();
697
+ await this.performActionsAfterSpin();
694
698
  }
695
699
  /**
696
700
  * Function for invoking free spin plate, invoked in mainContainer
@@ -27,6 +27,7 @@ export declare class SettingsStore {
27
27
  HiResolutionFlag: boolean;
28
28
  batterySaverFlag: boolean;
29
29
  gambleGameUsed: boolean;
30
+ isGambleGameActive: boolean;
30
31
  gambleGameWin: number;
31
32
  containersWithSpines: (ResumableContainer | SpineWithResumableContainer | SpriteWithResumableContainer)[];
32
33
  cumulativeWinAmount: number;
@@ -33,6 +33,7 @@ export class SettingsStore {
33
33
  HiResolutionFlag = getFromLocalStorage(LOCAL_STORAGE.hiResolution, true);
34
34
  batterySaverFlag = getFromLocalStorage(LOCAL_STORAGE.batterySaver, false);
35
35
  gambleGameUsed = false;
36
+ isGambleGameActive = false;
36
37
  gambleGameWin = 0;
37
38
  containersWithSpines = [];
38
39
  cumulativeWinAmount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
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",