pixi-rainman-game-engine 0.1.49 → 0.1.50

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.
@@ -35,9 +35,9 @@ export const defaultAppConfig = {
35
35
  freeSpinPlateVisibleTime: 2000,
36
36
  freeSpinSummaryVisibleTime: 2000,
37
37
  updatableTextCountingDuration: 500,
38
- scatterDelayerTime: 2000,
39
- scatterSpinningTime: 9200,
40
- mobileSpinTimeout: 300,
38
+ mobileSpinTimeout: 100,
39
+ scatterDelayerTime: 1000,
40
+ scatterSpinningTime: 1200,
41
41
  mysteryWinMinimumTime: 2000,
42
42
  bigWinMinimumTime: 2000,
43
43
  bigWinPhaseTimeout: 2800,
@@ -40,6 +40,15 @@
40
40
  height: 78px;
41
41
  background-repeat: no-repeat no-repeat;
42
42
  background-size: contain;
43
+ cursor: pointer;
44
+ }
45
+
46
+ .speed-settings-popup__option:hover {
47
+ background-image: url("/assets/settings/speedPopup/speed-frame-active.png");
48
+ width: 145px;
49
+ height: 78px;
50
+ background-repeat: no-repeat no-repeat;
51
+ background-size: contain;
43
52
  }
44
53
 
45
54
  .speed-settings-popup_option--active {
@@ -101,6 +110,25 @@
101
110
  }
102
111
  }
103
112
 
113
+ @media screen and (max-width: 450px) and (pointer: coarse) {
114
+ .speed-settings-popup__option {
115
+ width: 120px;
116
+ height: 66px;
117
+ }
118
+
119
+ .speed-settings-popup__option:hover {
120
+ background-image: url("/assets/settings/speedPopup/speed-frame-active.png");
121
+ background-repeat: no-repeat no-repeat;
122
+ background-size: contain;
123
+ }
124
+
125
+ .speed-settings-popup__option:focus {
126
+ background-image: url("/assets/settings/speedPopup/speed-frame-active.png");
127
+ background-repeat: no-repeat no-repeat;
128
+ background-size: contain;
129
+ }
130
+ }
131
+
104
132
  @media only screen and (max-height: 450px) {
105
133
  .speed-settings-modal {
106
134
  width: 80vw;
@@ -83,10 +83,15 @@ export class AbstractColumnsContainer extends Container {
83
83
  break;
84
84
  }
85
85
  const configureSpinAction = configuredBlindSpinsActions.shift();
86
+ indexesOfReelsToExtendSpinningTime.forEach((number) => {
87
+ this.allColumns[number].changeMultiplier();
88
+ });
86
89
  if (configureSpinAction !== undefined) {
87
90
  if (indexesOfReelsToExtendSpinningTime.includes(index)) {
88
91
  this.currentColumn = this.allColumns[index];
92
+ this.currentColumn.adaptToSpeed(RainMan.settingsStore.currentSpeed);
89
93
  frame.invokeMysteryFx(this.currentColumn.x, this.currentColumn.y);
94
+ await this.currentColumn.speedUpForMysterySpin(100, 1500);
90
95
  this.skipScatterDelay = configureSpinAction;
91
96
  setTimeout(() => {
92
97
  this.skipScatterDelay?.();
@@ -51,6 +51,8 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
51
51
  get id(): string;
52
52
  protected get componentsTimingSettings(): AnimationTimeSettings;
53
53
  adaptToSpeed(speedLevel: SpeedLevel): void;
54
+ changeMultiplier(): void;
55
+ speedUpForMysterySpin(velocity: number, duration: number): Promise<void>;
54
56
  changeVelocity(velocity: number, duration: number, frame?: AbstractFrame): Promise<void>;
55
57
  protected animateDependentComponents(_distance: number): void;
56
58
  animate(delta: number, lastTime: number): void;
@@ -79,6 +79,24 @@ export class AbstractSymbolsColumn extends Container {
79
79
  this.velocityMultiplier = this.speedLevelMapper[speedLevel];
80
80
  this.symbols.forEach((symbol) => symbol.updateTimeScaleOfSpine(this.velocityMultiplier));
81
81
  }
82
+ changeMultiplier() {
83
+ this.velocityMultiplier = 3.5;
84
+ }
85
+ async speedUpForMysterySpin(velocity, duration) {
86
+ await new Promise((resolve) => {
87
+ this.tween = new TWEEN.Tween({ velocity: velocity })
88
+ .to({ value: 70 }, duration)
89
+ .easing(TWEEN.Easing.Linear.None)
90
+ .onUpdate((value) => {
91
+ this.velocity = value.velocity;
92
+ })
93
+ .onComplete(() => {
94
+ this.tween = null;
95
+ resolve();
96
+ })
97
+ .start();
98
+ });
99
+ }
82
100
  async changeVelocity(velocity, duration, frame) {
83
101
  await new Promise((resolve) => {
84
102
  this.tween = new TWEEN.Tween({ velocity: velocity })
@@ -88,6 +106,15 @@ export class AbstractSymbolsColumn extends Container {
88
106
  .easing(TWEEN.Easing.Linear.None)
89
107
  .to({ velocity }, duration)
90
108
  .start()
109
+ .onComplete(async () => {
110
+ this.tween = null;
111
+ if (frame) {
112
+ await frame.hideMysteryFx();
113
+ frame.destroyMysteryFx();
114
+ }
115
+ this.skipHidingMysteryFx = false;
116
+ resolve();
117
+ })
91
118
  .onStop(async () => {
92
119
  this.tween = null;
93
120
  if (frame) {
@@ -17,8 +17,8 @@ export declare class DroppableSymbolsColumn {
17
17
  get symbolsToBeDestroyed(): DroppableSymbol[];
18
18
  get allSymbolsToBeMovedDown(): DroppableSymbol[];
19
19
  setSymbolsToBeDestroyed(rowIndex: number, replacementSymbol: SymbolId): void;
20
- playAnimations(): Promise<void[]>;
21
- destroyAnimations(isStandalone: boolean): Promise<void[]>;
20
+ playAnimations(): Promise<PromiseSettledResult<void>[]>;
21
+ destroyAnimations(isStandalone: boolean): Promise<PromiseSettledResult<void>[]>;
22
22
  moveDestroyedSymbolsToTop(tileHeight: number): void;
23
23
  swapDestroyedSymbols(): void;
24
24
  /**
@@ -34,7 +34,7 @@ export class DroppableSymbolsColumn {
34
34
  this.sortableSymbols[rowIndex].referencedYInColumn = rowIndex;
35
35
  }
36
36
  async playAnimations() {
37
- return await Promise.all(this.symbolsToBeDestroyed.map((symbol) => symbol.symbol.play()));
37
+ return await Promise.allSettled(this.symbolsToBeDestroyed.map((symbol) => symbol.symbol.play()));
38
38
  }
39
39
  async destroyAnimations(isStandalone) {
40
40
  const destroyedSymbols = [];
@@ -43,7 +43,7 @@ export class DroppableSymbolsColumn {
43
43
  destroyedSymbols.push(symbol.symbol.handlePopSymbol(isStandalone));
44
44
  this._numberToBeDropped++;
45
45
  });
46
- return await Promise.all(destroyedSymbols);
46
+ return await Promise.allSettled(destroyedSymbols);
47
47
  }
48
48
  moveDestroyedSymbolsToTop(tileHeight) {
49
49
  this.symbolsToBeDestroyed.forEach((symbols, index) => {
@@ -8,7 +8,7 @@ export interface AnimationTimeSettings {
8
8
  }
9
9
  export declare enum Speed {
10
10
  FAST = 70,
11
- STOP = 15
11
+ STOP = 65
12
12
  }
13
13
  /**
14
14
  * Enum that describes the phase of columns
@@ -1,7 +1,7 @@
1
1
  export var Speed;
2
2
  (function (Speed) {
3
3
  Speed[Speed["FAST"] = 70] = "FAST";
4
- Speed[Speed["STOP"] = 15] = "STOP";
4
+ Speed[Speed["STOP"] = 65] = "STOP";
5
5
  })(Speed || (Speed = {}));
6
6
  /**
7
7
  * Enum that describes the phase of columns
@@ -49,6 +49,7 @@ export declare abstract class AbstractController<T> {
49
49
  private componentRegistry;
50
50
  protected skipFreeSpinSummary: boolean;
51
51
  protected scatterCountForFx: number;
52
+ protected isLongPress: boolean;
52
53
  protected _lastWinAmount: number;
53
54
  protected constructor(buttonsEventManager: ButtonsEventManager, mainContainer: AbstractMainContainer, connection: SubscribableConnectionWrapper);
54
55
  init(): void;
@@ -48,6 +48,7 @@ export class AbstractController {
48
48
  componentRegistry;
49
49
  skipFreeSpinSummary = false;
50
50
  scatterCountForFx = 2;
51
+ isLongPress = false;
51
52
  _lastWinAmount = 0;
52
53
  constructor(buttonsEventManager, mainContainer, connection) {
53
54
  this.buttonsEventManager = buttonsEventManager;
@@ -184,17 +185,25 @@ export class AbstractController {
184
185
  const refreshButton = RainMan.componentRegistry.get(RefreshButton.registryName);
185
186
  refreshButton.setOnClick(() => this.handleSpinLogic());
186
187
  const clearMobileSpinTimeout = () => {
187
- if (!this.mobileSpinTimeout)
188
- return;
189
- clearInterval(this.mobileSpinTimeout);
190
- this.mobileSpinTimeout = null;
188
+ if (this.mobileSpinTimeout) {
189
+ clearInterval(this.mobileSpinTimeout);
190
+ this.mobileSpinTimeout = null;
191
+ }
192
+ this.isLongPress = false;
191
193
  };
192
194
  refreshButton.on("touchstart", () => {
193
- if (this.mobileSpinTimeout !== null)
194
- return;
195
- this.mobileSpinTimeout = setInterval(() => this.handleSpinLogic(), RainMan.config.durationOfActions.mobileSpinTimeout);
195
+ this.isLongPress = false;
196
+ this.mobileSpinTimeout = setInterval(() => {
197
+ this.isLongPress = true;
198
+ this.throttledSpin();
199
+ }, RainMan.config.durationOfActions.mobileSpinTimeout);
200
+ });
201
+ refreshButton.on("touchend", () => {
202
+ if (this.isLongPress) {
203
+ this.handleSpinLogic();
204
+ }
205
+ clearMobileSpinTimeout();
196
206
  });
197
- refreshButton.on("touchend", () => clearMobileSpinTimeout());
198
207
  refreshButton.on("globaltouchmove", (event) => {
199
208
  if (event.target !== refreshButton)
200
209
  clearMobileSpinTimeout();
@@ -777,10 +786,12 @@ export class AbstractController {
777
786
  .get(COMPONENTS.mysteryWin)
778
787
  .randomizeSet(winAmount, RainMan.settingsStore.getMysteryPaytable(this.mysteryWinSymbol, quantity));
779
788
  SoundManager.pause(SoundTracks.mysteryDrawLoop);
789
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
790
+ this.uiController.limitWinAmount(this.uiController.totalFreeSpinWinAmount + winAmount);
791
+ this.uiController.increaseTotalFreeSpinWinAmount(winAmount);
792
+ }
780
793
  this.updateUiValues(winAmount);
781
794
  this._lastWinAmount += winAmount;
782
- if (RainMan.settingsStore.isFreeSpinsPlayEnabled)
783
- this.uiController.increaseTotalFreeSpinWinAmount(winAmount);
784
795
  await new Promise((resolve) => {
785
796
  this.resolveMysteryWin = resolve;
786
797
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
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",