pixi-rainman-game-engine 0.3.0 → 0.3.2
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.
- package/dist/ComponentRegistry/ComponentRegistry.d.ts +23 -9
- package/dist/ComponentRegistry/ComponentRegistry.js +25 -10
- package/dist/ComponentRegistry/types.d.ts +3 -4
- package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +2 -0
- package/dist/DescribedPlayableAction/DescribedPlayableAction.js +2 -0
- package/dist/Money/MoneyText.d.ts +5 -0
- package/dist/Money/MoneyText.js +5 -0
- package/dist/Rainman/appConfig.js +1 -0
- package/dist/Rainman/types.d.ts +1 -0
- package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.d.ts +4 -0
- package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.js +4 -0
- package/dist/SettingsUI/hooks/useDeviceOrientations.d.ts +4 -0
- package/dist/SettingsUI/hooks/useDeviceOrientations.js +4 -0
- package/dist/application/ApiConfig/ApiConfig.d.ts +2 -1
- package/dist/application/ApiConfig/ApiConfig.js +3 -2
- package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +42 -5
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +51 -9
- package/dist/application/SoundManager/SoundManager.d.ts +26 -1
- package/dist/application/SoundManager/SoundManager.js +30 -2
- package/dist/application/SpeedState/SpeedAdapter.d.ts +9 -0
- package/dist/application/SpeedState/SpeedAdapter.js +9 -0
- package/dist/application/SpeedState/SpeedLevel.d.ts +42 -0
- package/dist/application/SpeedState/SpeedLevel.js +30 -0
- package/dist/application/SpeedState/SpeedLevelHandler.d.ts +7 -0
- package/dist/application/SpeedState/SpeedLevelHandler.js +7 -0
- package/dist/application/SpinLogic/SpinLogic.d.ts +58 -0
- package/dist/application/SpinLogic/SpinLogic.js +58 -0
- package/dist/application/SpinLogic/SpinLogicDTO.d.ts +70 -0
- package/dist/application/SpinLogic/SpinLogicDTO.js +70 -0
- package/dist/application/SpinLogic/WinScenarios.d.ts +12 -0
- package/dist/application/SpinLogic/WinScenarios.js +12 -0
- package/dist/application/SpinLogic/types.d.ts +10 -0
- package/dist/application/TimedActions/IncentiveComponent.d.ts +10 -0
- package/dist/application/TimedActions/IncentiveComponent.js +9 -1
- package/dist/application/TimedActions/TimedIncentiveController.d.ts +37 -0
- package/dist/application/TimedActions/TimedIncentiveController.js +37 -0
- package/dist/application/setup.d.ts +0 -1
- package/dist/application/setup.js +0 -1
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +36 -1
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +25 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +83 -2
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +97 -11
- package/dist/components/DoubleBorderText/DoubleBorderText.d.ts +10 -0
- package/dist/components/DoubleBorderText/DoubleBorderText.js +24 -0
- package/dist/components/DoubleBorderText/index.d.ts +1 -0
- package/dist/components/DoubleBorderText/index.js +1 -0
- package/dist/components/GambleGame/GambleGame.d.ts +39 -0
- package/dist/components/GambleGame/GambleGame.js +44 -3
- package/dist/components/GambleGame/types.d.ts +5 -0
- package/dist/components/buttons/BaseButton/BaseButton.d.ts +73 -2
- package/dist/components/buttons/BaseButton/BaseButton.js +73 -2
- package/dist/components/buttons/BaseButton/types.d.ts +5 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +11 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.js +11 -0
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +13 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +13 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsMobile.d.ts +19 -1
- package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +19 -1
- package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +27 -2
- package/dist/components/buttons/buttonGroups/MiddleButtons.js +46 -3
- package/dist/components/buttons/buttonGroups/RightButtons.d.ts +19 -3
- package/dist/components/buttons/buttonGroups/RightButtons.js +29 -1
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.d.ts +11 -0
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +11 -0
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.d.ts +17 -0
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +17 -0
- package/dist/components/buttons/default/AutoplayButton.d.ts +6 -0
- package/dist/components/buttons/default/AutoplayButton.js +8 -1
- package/dist/components/buttons/default/GambleButton.d.ts +13 -0
- package/dist/components/buttons/default/GambleButton.js +43 -0
- package/dist/components/buttons/default/RefreshButton.d.ts +30 -0
- package/dist/components/buttons/default/RefreshButton.js +36 -3
- package/dist/components/buttons/default/SpeedControlButton.d.ts +2 -0
- package/dist/components/buttons/default/SpeedControlButton.js +2 -0
- package/dist/components/buttons/default/TakeButton.d.ts +13 -0
- package/dist/components/buttons/default/TakeButton.js +37 -0
- package/dist/components/buttons/default/VolumeButton.d.ts +2 -0
- package/dist/components/buttons/default/VolumeButton.js +2 -0
- package/dist/components/buttons/default/index.d.ts +2 -0
- package/dist/components/buttons/default/index.js +2 -0
- package/dist/components/buttons/registrynames.d.ts +2 -0
- package/dist/components/buttons/registrynames.js +3 -1
- package/dist/components/common/AnimatedBackground.d.ts +22 -0
- package/dist/components/common/AnimatedBackground.js +22 -0
- package/dist/components/common/AnimatedNumber.d.ts +36 -0
- package/dist/components/common/AnimatedNumber.js +36 -0
- package/dist/components/common/Background.d.ts +20 -0
- package/dist/components/common/Background.js +22 -1
- package/dist/components/common/FreeSpinButton.d.ts +33 -1
- package/dist/components/common/FreeSpinButton.js +37 -4
- package/dist/components/common/IResizableContainer.d.ts +4 -0
- package/dist/components/common/Logo.d.ts +21 -0
- package/dist/components/common/Logo.js +21 -0
- package/dist/components/common/LogoStatic.d.ts +10 -0
- package/dist/components/common/LogoStatic.js +10 -0
- package/dist/components/common/ResponsiveComponent.d.ts +22 -0
- package/dist/components/common/ResponsiveComponent.js +10 -0
- package/dist/components/common/ResumableContainers.d.ts +6 -0
- package/dist/components/common/ResumableContainers.js +6 -0
- package/dist/components/common/ScalableSpine.d.ts +11 -0
- package/dist/components/common/ScalableSpine.js +11 -0
- package/dist/components/frame/AbstractColumnsContainer.d.ts +20 -6
- package/dist/components/frame/AbstractColumnsContainer.js +18 -4
- package/dist/components/frame/AbstractFrame.d.ts +115 -0
- package/dist/components/frame/AbstractFrame.js +97 -2
- package/dist/components/frame/AbstractInnerFrame.d.ts +5 -0
- package/dist/components/frame/AbstractInnerFrame.js +5 -0
- package/dist/components/frame/WinLineAnimation.d.ts +10 -0
- package/dist/components/frame/WinLineAnimation.js +12 -1
- package/dist/components/frame/constants.d.ts +7 -0
- package/dist/components/frame/constants.js +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/messageBox/MessageBox.d.ts +33 -0
- package/dist/components/messageBox/MessageBox.js +34 -1
- package/dist/components/symbols/AbstractSymbolBase.d.ts +146 -2
- package/dist/components/symbols/AbstractSymbolBase.js +137 -14
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +233 -3
- package/dist/components/symbols/AbstractSymbolsColumn.js +220 -10
- package/dist/components/symbols/DroppableSymbol.d.ts +16 -0
- package/dist/components/symbols/DroppableSymbol.js +16 -0
- package/dist/components/symbols/DroppableSymbolsColumn.d.ts +51 -0
- package/dist/components/symbols/DroppableSymbolsColumn.js +57 -3
- package/dist/components/symbols/types.d.ts +8 -0
- package/dist/components/symbols/types.js +4 -0
- package/dist/components/updatable/GambleUpdatableText.d.ts +5 -0
- package/dist/components/updatable/GambleUpdatableText.js +5 -0
- package/dist/components/updatable/StylefulUpdatableText.d.ts +23 -0
- package/dist/components/updatable/StylefulUpdatableText.js +25 -1
- package/dist/components/updatable/UpdatableValueComponent.d.ts +71 -0
- package/dist/components/updatable/UpdatableValueComponent.js +77 -4
- package/dist/connectivity/ConnectionWrapper.d.ts +20 -1
- package/dist/connectivity/ConnectionWrapper.js +23 -3
- package/dist/connectivity/LocalConnectionWrapper.d.ts +2 -2
- package/dist/connectivity/LocalConnectionWrapper.js +2 -2
- package/dist/connectivity/serverConnection.d.ts +59 -0
- package/dist/connectivity/serverData.d.ts +3 -1
- package/dist/connectivity/spinData.d.ts +15 -0
- package/dist/connectivity/spinData.js +15 -0
- package/dist/constants/gamePhase.d.ts +4 -0
- package/dist/controllers/AbstractController.d.ts +114 -5
- package/dist/controllers/AbstractController.js +180 -37
- package/dist/controllers/QuickStopController.d.ts +3 -0
- package/dist/controllers/QuickStopController.js +3 -0
- package/dist/controllers/UiController.d.ts +163 -1
- package/dist/controllers/UiController.js +170 -5
- package/dist/errors/LanguageNotDefinedError.d.ts +4 -0
- package/dist/errors/LanguageNotDefinedError.js +4 -0
- package/dist/errors/SpineDataNotFound.d.ts +4 -0
- package/dist/errors/SpineDataNotFound.js +4 -0
- package/dist/errors/TextureNotFound.d.ts +4 -0
- package/dist/errors/TextureNotFound.js +4 -0
- package/dist/loading/AbstractLoadingContainer.d.ts +16 -0
- package/dist/loading/AbstractLoadingContainer.js +16 -0
- package/dist/loading/SpriteLoadingContainer.d.ts +18 -0
- package/dist/loading/SpriteLoadingContainer.js +18 -0
- package/dist/localStorage/localStorage.d.ts +23 -0
- package/dist/localStorage/localStorage.js +19 -0
- package/dist/stores/SettingsStore.d.ts +276 -4
- package/dist/stores/SettingsStore.js +309 -14
- package/dist/stores/types.d.ts +4 -0
- package/dist/utils/assets/assetGetter.js +6 -3
- package/dist/utils/common/deviceOrientation.js +2 -1
- package/dist/utils/common/functions.d.ts +57 -1
- package/dist/utils/common/functions.js +63 -4
- package/dist/utils/common/logger.js +4 -2
- package/dist/utils/common/placementHelpers.d.ts +14 -0
- package/dist/utils/common/placementHelpers.js +20 -1
- package/dist/utils/common/screenHelpers.d.ts +28 -0
- package/dist/utils/common/screenHelpers.js +34 -3
- package/dist/utils/common/sound.d.ts +1 -0
- package/dist/utils/common/sound.js +2 -0
- package/dist/utils/common/stats.d.ts +1 -0
- package/dist/utils/common/stats.js +2 -0
- package/dist/winComponents/AnimableParticlesEmitter.d.ts +6 -0
- package/dist/winComponents/AnimableParticlesEmitter.js +6 -0
- package/dist/winComponents/BaseWinContainer.d.ts +64 -0
- package/dist/winComponents/BaseWinContainer.js +66 -1
- package/dist/winComponents/PositioningFrame.d.ts +7 -0
- package/dist/winComponents/PositioningFrame.js +7 -0
- package/dist/winComponents/TexturedText.d.ts +23 -0
- package/dist/winComponents/TexturedText.js +23 -0
- package/dist/winComponents/UpdatableSpineContainer.d.ts +25 -0
- package/dist/winComponents/UpdatableSpineContainer.js +25 -0
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ import { MessageBox } from "../messageBox";
|
|
|
22
22
|
* - {@link overlay} - overlay, used when modal is shown
|
|
23
23
|
* - {@link gambleGame} - gamble game
|
|
24
24
|
* @abstract
|
|
25
|
+
* @class AbstractMainContainer
|
|
25
26
|
* @augments {Container}
|
|
26
27
|
*/
|
|
27
28
|
export class AbstractMainContainer extends Container {
|
|
@@ -68,6 +69,7 @@ export class AbstractMainContainer extends Container {
|
|
|
68
69
|
}
|
|
69
70
|
/**
|
|
70
71
|
* Function for invoking mystery win plate
|
|
72
|
+
* @public
|
|
71
73
|
* @param {string} _animationName - The name of the animation to play.
|
|
72
74
|
* @param {string} _popupAnimation - The name of the popup animation to play.
|
|
73
75
|
* @param {WinTypeId} _winType - The type of win to display.
|
|
@@ -78,7 +80,9 @@ export class AbstractMainContainer extends Container {
|
|
|
78
80
|
async invokeMysteryWinPlate(_animationName, _popupAnimation, _winType, _amount, _isAdditionalFreeSpins) { }
|
|
79
81
|
/**
|
|
80
82
|
* This function initializes the spines that should be paused when the battery saver is on
|
|
83
|
+
* @protected
|
|
81
84
|
* @param {typeof RainMan.settingsStore.containersWithSpines} containersWithSpines - array of containers with spines
|
|
85
|
+
* @returns {void}
|
|
82
86
|
*/
|
|
83
87
|
triggerStoreInitState(...containersWithSpines) {
|
|
84
88
|
RainMan.settingsStore.containersWithSpines.push(...containersWithSpines);
|
|
@@ -86,6 +90,7 @@ export class AbstractMainContainer extends Container {
|
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
88
92
|
* Function for getting free spin plate
|
|
93
|
+
* @public
|
|
89
94
|
* @returns {Nullable<AbstractFreeSpinContainer>} The container for the free spin plate, or null if not set.
|
|
90
95
|
*/
|
|
91
96
|
get freeSpinPlate() {
|
|
@@ -93,6 +98,7 @@ export class AbstractMainContainer extends Container {
|
|
|
93
98
|
}
|
|
94
99
|
/**
|
|
95
100
|
* Function for getting free spin summary
|
|
101
|
+
* @public
|
|
96
102
|
* @returns {Nullable<AbstractFreeSpinContainer>} The container for the free spin summary, or null if not set.
|
|
97
103
|
*/
|
|
98
104
|
get freeSpinSummary() {
|
|
@@ -100,6 +106,7 @@ export class AbstractMainContainer extends Container {
|
|
|
100
106
|
}
|
|
101
107
|
/**
|
|
102
108
|
* Function for creating free spin container
|
|
109
|
+
* @protected
|
|
103
110
|
* @param {() => void} _resolver - resolver for promise
|
|
104
111
|
* @param {number} _freeSpinCount - number of free spins
|
|
105
112
|
* @param {boolean} _isAdditionalFreeSpin - flag for displaying additional free spins
|
|
@@ -110,6 +117,7 @@ export class AbstractMainContainer extends Container {
|
|
|
110
117
|
}
|
|
111
118
|
/**
|
|
112
119
|
* Function for creating bonus win container
|
|
120
|
+
* @protected
|
|
113
121
|
* @returns {Nullable<UpdatableSpineContainer>} The container for the bonus win animation, or null.
|
|
114
122
|
*/
|
|
115
123
|
createBonusWinContainer() {
|
|
@@ -117,6 +125,7 @@ export class AbstractMainContainer extends Container {
|
|
|
117
125
|
}
|
|
118
126
|
/**
|
|
119
127
|
* Creates a container for the super bonus win animation.
|
|
128
|
+
* @protected
|
|
120
129
|
* @returns {UpdatableSpineContainer | null} The container for the super bonus win animation, or null.
|
|
121
130
|
*/
|
|
122
131
|
createSuperBonusWinContainer() {
|
|
@@ -124,6 +133,7 @@ export class AbstractMainContainer extends Container {
|
|
|
124
133
|
}
|
|
125
134
|
/**
|
|
126
135
|
* Function for creating mystery win container
|
|
136
|
+
* @protected
|
|
127
137
|
* @returns {Nullable<UpdatableSpineContainer>} The container for the mystery win animation, or null.
|
|
128
138
|
*/
|
|
129
139
|
createMysteryWinContainer() {
|
|
@@ -131,6 +141,7 @@ export class AbstractMainContainer extends Container {
|
|
|
131
141
|
}
|
|
132
142
|
/**
|
|
133
143
|
* Function for creating mystery bonus container
|
|
144
|
+
* @protected
|
|
134
145
|
* @param {string} _animationName - animation name for the mystery bonus container
|
|
135
146
|
* @returns {Nullable<UpdatableSpineContainer>} The container for the mystery bonus animation, or null.
|
|
136
147
|
*/
|
|
@@ -141,15 +152,20 @@ export class AbstractMainContainer extends Container {
|
|
|
141
152
|
* Function for specifying the container for the free spin summary
|
|
142
153
|
* This needs to be implemented in each game
|
|
143
154
|
* In some cases there will be free spin button that should be removed during free spins
|
|
155
|
+
* @protected
|
|
156
|
+
* @returns {void}
|
|
144
157
|
*/
|
|
145
158
|
changeContainerForFreeSpin() { }
|
|
146
159
|
/**
|
|
147
160
|
* Function for specifying the container for base game
|
|
148
161
|
* This needs to be implemented in each game
|
|
162
|
+
* @protected
|
|
163
|
+
* @returns {void}
|
|
149
164
|
*/
|
|
150
165
|
changeContainerForBaseGame() { }
|
|
151
166
|
/**
|
|
152
167
|
* Function for creating roulette win container
|
|
168
|
+
* @protected
|
|
153
169
|
* @param {string} _animationName animation name for the roulette container
|
|
154
170
|
* @returns {Nullable<UpdatableSpineContainer>} The container for the roulette win animation, or null.
|
|
155
171
|
*/
|
|
@@ -158,6 +174,7 @@ export class AbstractMainContainer extends Container {
|
|
|
158
174
|
}
|
|
159
175
|
/**
|
|
160
176
|
* Function for destroying the roulette win container
|
|
177
|
+
* @protected
|
|
161
178
|
* @param {WinTypeId} winType win type of jackpot roulette win
|
|
162
179
|
* @returns {void}
|
|
163
180
|
*/
|
|
@@ -173,6 +190,7 @@ export class AbstractMainContainer extends Container {
|
|
|
173
190
|
}
|
|
174
191
|
/**
|
|
175
192
|
* Function for invoking mystery bonus container
|
|
193
|
+
* @protected
|
|
176
194
|
* @param {string} animationName animation name for the mystery bonus container
|
|
177
195
|
* @returns {Promise<void>}
|
|
178
196
|
*/
|
|
@@ -196,8 +214,10 @@ export class AbstractMainContainer extends Container {
|
|
|
196
214
|
* Function for invoking free spin plate
|
|
197
215
|
* If game draw an additional free spin, you can set isAdditionalFreeSpin to true
|
|
198
216
|
* and it will display additional free spin plate
|
|
217
|
+
* @public
|
|
199
218
|
* @param {number} freeSpinCount - number of free spins
|
|
200
219
|
* @param {boolean} isAdditionalFreeSpin - flag for displaying additional free spins
|
|
220
|
+
* @returns {Promise<void>}
|
|
201
221
|
*/
|
|
202
222
|
async invokeFreeSpinPlate(freeSpinCount, isAdditionalFreeSpin = false) {
|
|
203
223
|
const refreshButton = RainMan.componentRegistry.get(RefreshButton.registryName);
|
|
@@ -220,6 +240,7 @@ export class AbstractMainContainer extends Container {
|
|
|
220
240
|
}
|
|
221
241
|
/**
|
|
222
242
|
* Function for creating free spin summary
|
|
243
|
+
* @protected
|
|
223
244
|
* @param {void} _resolver - resolver for promise
|
|
224
245
|
* @param {number} _freeSpinCount - number of free spins
|
|
225
246
|
* @param {number} _winAmount - win amount during free spins
|
|
@@ -230,8 +251,10 @@ export class AbstractMainContainer extends Container {
|
|
|
230
251
|
}
|
|
231
252
|
/**
|
|
232
253
|
* Function for invoking free spin summary
|
|
254
|
+
* @public
|
|
233
255
|
* @param {number} freeSpinCount - amount of free spins
|
|
234
256
|
* @param {number} winAmount - win amount during free spins
|
|
257
|
+
* @returns {Promise<void>}
|
|
235
258
|
*/
|
|
236
259
|
async invokeFreeSpinSummary(freeSpinCount, winAmount) {
|
|
237
260
|
const refreshButton = RainMan.componentRegistry.get(BUTTONS.refresh);
|
|
@@ -253,11 +276,13 @@ export class AbstractMainContainer extends Container {
|
|
|
253
276
|
}
|
|
254
277
|
/**
|
|
255
278
|
* Function for hiding free spin summary
|
|
279
|
+
* @public
|
|
256
280
|
* @returns {void}
|
|
257
281
|
*/
|
|
258
282
|
hideFreeSpinSummary() {
|
|
259
|
-
if (!this.freeSpinSummary)
|
|
283
|
+
if (!this.freeSpinSummary) {
|
|
260
284
|
return;
|
|
285
|
+
}
|
|
261
286
|
this.freeSpinSummary.onClick();
|
|
262
287
|
this.removeChild(this.freeSpinSummary);
|
|
263
288
|
this._freeSpinSummary = null;
|
|
@@ -267,6 +292,8 @@ export class AbstractMainContainer extends Container {
|
|
|
267
292
|
* Function for showing the overlay
|
|
268
293
|
* This function creates a semi-transparent overlay that covers the entire screen.
|
|
269
294
|
* It is used to block interactions with the game while a modal is displayed.
|
|
295
|
+
* @protected
|
|
296
|
+
* @returns {void}
|
|
270
297
|
*/
|
|
271
298
|
showOverlay() {
|
|
272
299
|
const { width, height } = RainMan.app.screen;
|
|
@@ -282,6 +309,8 @@ export class AbstractMainContainer extends Container {
|
|
|
282
309
|
/**
|
|
283
310
|
* Function for hiding the overlay
|
|
284
311
|
* This function removes the overlay from the main container and sets it to null.
|
|
312
|
+
* @protected
|
|
313
|
+
* @returns {void}
|
|
285
314
|
*/
|
|
286
315
|
hideOverlay() {
|
|
287
316
|
if (this.overlay) {
|
|
@@ -291,6 +320,7 @@ export class AbstractMainContainer extends Container {
|
|
|
291
320
|
}
|
|
292
321
|
/**
|
|
293
322
|
* Function for getting the time since the big win was invoked.
|
|
323
|
+
* @public
|
|
294
324
|
* @returns {number} The time in milliseconds since the big win was invoked, or 0 if it has not been invoked.
|
|
295
325
|
*/
|
|
296
326
|
get bigWinVisibleFor() {
|
|
@@ -298,6 +328,7 @@ export class AbstractMainContainer extends Container {
|
|
|
298
328
|
}
|
|
299
329
|
/**
|
|
300
330
|
* Function for getting the free spin button.
|
|
331
|
+
* @public
|
|
301
332
|
* @returns {typeof this.freeSpinButton} The free spin button instance.
|
|
302
333
|
*/
|
|
303
334
|
getFreeSpinButton() {
|
|
@@ -305,6 +336,7 @@ export class AbstractMainContainer extends Container {
|
|
|
305
336
|
}
|
|
306
337
|
/**
|
|
307
338
|
* Function for getting the time since the mystery win was invoked.
|
|
339
|
+
* @public
|
|
308
340
|
* @returns {number} The time in milliseconds since the mystery win was invoked, or 0 if it has not been invoked.
|
|
309
341
|
*/
|
|
310
342
|
get mysteryWinVisibleFor() {
|
|
@@ -312,6 +344,7 @@ export class AbstractMainContainer extends Container {
|
|
|
312
344
|
}
|
|
313
345
|
/**
|
|
314
346
|
* Function for getting the time since the bonus win was invoked.
|
|
347
|
+
* @public
|
|
315
348
|
* @returns {number} The time in milliseconds since the bonus win was invoked, or 0 if it has not been invoked.
|
|
316
349
|
*/
|
|
317
350
|
get bonusWinVisibleFor() {
|
|
@@ -319,6 +352,7 @@ export class AbstractMainContainer extends Container {
|
|
|
319
352
|
}
|
|
320
353
|
/**
|
|
321
354
|
* Function for getting the time since the super bonus win was invoked.
|
|
355
|
+
* @public
|
|
322
356
|
* @returns {number} The time in milliseconds since the super bonus win was invoked, or 0 if it has not been invoked.
|
|
323
357
|
*/
|
|
324
358
|
get superBonusWinVisibleFor() {
|
|
@@ -326,6 +360,8 @@ export class AbstractMainContainer extends Container {
|
|
|
326
360
|
}
|
|
327
361
|
/**
|
|
328
362
|
* Function for invoking big win animation, using `this.createBigWinContainer()` abstract function.
|
|
363
|
+
* @public
|
|
364
|
+
* @returns {void}
|
|
329
365
|
*/
|
|
330
366
|
invokeBigWin() {
|
|
331
367
|
if (this.bigWinContainer !== null) {
|
|
@@ -343,6 +379,8 @@ export class AbstractMainContainer extends Container {
|
|
|
343
379
|
}
|
|
344
380
|
/**
|
|
345
381
|
* Function for invoking big win animation, using `this.createSuperBonusWinContainer()` abstract function.
|
|
382
|
+
* @public
|
|
383
|
+
* @returns {void}
|
|
346
384
|
*/
|
|
347
385
|
invokeSuperBonusWin() {
|
|
348
386
|
if (this.superBonusWinContainer !== null) {
|
|
@@ -350,8 +388,9 @@ export class AbstractMainContainer extends Container {
|
|
|
350
388
|
}
|
|
351
389
|
const { width, height } = RainMan.app.screen;
|
|
352
390
|
this.superBonusWinContainer = this.createSuperBonusWinContainer();
|
|
353
|
-
if (!this.superBonusWinContainer)
|
|
391
|
+
if (!this.superBonusWinContainer) {
|
|
354
392
|
return;
|
|
393
|
+
}
|
|
355
394
|
this.superBonusWinContainer.x = width / 2;
|
|
356
395
|
this.superBonusWinContainer.y = height / 2;
|
|
357
396
|
this.superBonusWinContainer.resize();
|
|
@@ -361,14 +400,17 @@ export class AbstractMainContainer extends Container {
|
|
|
361
400
|
}
|
|
362
401
|
/**
|
|
363
402
|
* Function for invoking big win animation, using `this.createBonusWinContainer()` abstract function.
|
|
403
|
+
* @public
|
|
404
|
+
* @returns {void}
|
|
364
405
|
*/
|
|
365
406
|
invokeBonusWin() {
|
|
366
407
|
if (this.bonusWinContainer !== null) {
|
|
367
408
|
throw new Error("😡 Bonus Win is already declared");
|
|
368
409
|
}
|
|
369
410
|
this.bonusWinContainer = this.createBonusWinContainer();
|
|
370
|
-
if (!this.bonusWinContainer)
|
|
411
|
+
if (!this.bonusWinContainer) {
|
|
371
412
|
return;
|
|
413
|
+
}
|
|
372
414
|
this.bonusWinContainer.resize();
|
|
373
415
|
this.bonusWinContainer.parentLayer = UXLayer;
|
|
374
416
|
this.addChild(this.bonusWinContainer);
|
|
@@ -376,6 +418,8 @@ export class AbstractMainContainer extends Container {
|
|
|
376
418
|
}
|
|
377
419
|
/**
|
|
378
420
|
* Function for invoking mystery win animation, using `this.createMysteryWinContainer()` abstract function.
|
|
421
|
+
* @public
|
|
422
|
+
* @returns {void}
|
|
379
423
|
*/
|
|
380
424
|
invokeMysteryWin() {
|
|
381
425
|
if (this.mysteryWinContainer !== null) {
|
|
@@ -383,8 +427,9 @@ export class AbstractMainContainer extends Container {
|
|
|
383
427
|
}
|
|
384
428
|
const { width, height } = RainMan.app.screen;
|
|
385
429
|
this.mysteryWinContainer = this.createMysteryWinContainer();
|
|
386
|
-
if (!this.mysteryWinContainer)
|
|
430
|
+
if (!this.mysteryWinContainer) {
|
|
387
431
|
return;
|
|
432
|
+
}
|
|
388
433
|
this.mysteryWinContainer.x = width / 2;
|
|
389
434
|
this.mysteryWinContainer.y = height / 2;
|
|
390
435
|
this.mysteryWinContainer.resize();
|
|
@@ -396,10 +441,13 @@ export class AbstractMainContainer extends Container {
|
|
|
396
441
|
* Function for destroying the big win container
|
|
397
442
|
* This function removes the big win container from the main container,
|
|
398
443
|
* destroys its animations, and sets it to null.
|
|
444
|
+
* @public
|
|
445
|
+
* @returns {void}
|
|
399
446
|
*/
|
|
400
447
|
destroyBigWin() {
|
|
401
|
-
if (this.bigWinContainer === null)
|
|
448
|
+
if (this.bigWinContainer === null) {
|
|
402
449
|
return;
|
|
450
|
+
}
|
|
403
451
|
this.removeChild(this.bigWinContainer);
|
|
404
452
|
this.bigWinContainer.destroyAnimations();
|
|
405
453
|
this.bigWinContainer.destroy({ children: true });
|
|
@@ -408,10 +456,13 @@ export class AbstractMainContainer extends Container {
|
|
|
408
456
|
}
|
|
409
457
|
/**
|
|
410
458
|
* Function for destroying the mystery win container
|
|
459
|
+
* @public
|
|
460
|
+
* @returns {void}
|
|
411
461
|
*/
|
|
412
462
|
destroyMysteryWin() {
|
|
413
|
-
if (this.mysteryWinContainer === null)
|
|
463
|
+
if (this.mysteryWinContainer === null) {
|
|
414
464
|
return;
|
|
465
|
+
}
|
|
415
466
|
this.removeChild(this.mysteryWinContainer);
|
|
416
467
|
this.mysteryWinContainer.destroyAnimations();
|
|
417
468
|
this.mysteryWinContainer.destroy({ children: true });
|
|
@@ -420,10 +471,14 @@ export class AbstractMainContainer extends Container {
|
|
|
420
471
|
}
|
|
421
472
|
/**
|
|
422
473
|
* Function for destroying the bonus win container
|
|
474
|
+
* **NOTE**: This is used in game like LDE/LP, where there is different behavior for bonus wins
|
|
475
|
+
* @public
|
|
476
|
+
* @returns {void}
|
|
423
477
|
*/
|
|
424
478
|
destroyBonusWin() {
|
|
425
|
-
if (this.bonusWinContainer === null)
|
|
479
|
+
if (this.bonusWinContainer === null) {
|
|
426
480
|
return;
|
|
481
|
+
}
|
|
427
482
|
this.removeChild(this.bonusWinContainer);
|
|
428
483
|
this.bonusWinContainer.destroyAnimations();
|
|
429
484
|
this.bonusWinContainer.destroy({ children: true });
|
|
@@ -432,19 +487,29 @@ export class AbstractMainContainer extends Container {
|
|
|
432
487
|
}
|
|
433
488
|
/**
|
|
434
489
|
* Function for destroying the super bonus win container
|
|
490
|
+
* **NOTE**: This is used in game like LDE/LP, where there is different behavior for super bonus wins
|
|
491
|
+
* @public
|
|
492
|
+
* @returns {void}
|
|
435
493
|
*/
|
|
436
494
|
destroySuperBonusWin() {
|
|
437
|
-
if (this.superBonusWinContainer === null)
|
|
495
|
+
if (this.superBonusWinContainer === null) {
|
|
438
496
|
return;
|
|
497
|
+
}
|
|
439
498
|
this.removeChild(this.superBonusWinContainer);
|
|
440
499
|
this.superBonusWinContainer.destroyAnimations();
|
|
441
500
|
this.superBonusWinContainer.destroy({ children: true });
|
|
442
501
|
this.superBonusWinContainer = null;
|
|
443
502
|
this._superBonusWinInvokedAt = null;
|
|
444
503
|
}
|
|
504
|
+
/**
|
|
505
|
+
* This is used in game like DC where we have container that draws the bonus or jackpots
|
|
506
|
+
* @public
|
|
507
|
+
* @returns {void}
|
|
508
|
+
*/
|
|
445
509
|
destroyMysteryBonus() {
|
|
446
|
-
if (!this.mysteryBonusContainer)
|
|
510
|
+
if (!this.mysteryBonusContainer) {
|
|
447
511
|
return;
|
|
512
|
+
}
|
|
448
513
|
this.removeChild(this.mysteryBonusContainer);
|
|
449
514
|
this.mysteryBonusContainer.destroyAnimations();
|
|
450
515
|
this.mysteryBonusContainer.destroy({ children: true });
|
|
@@ -452,6 +517,7 @@ export class AbstractMainContainer extends Container {
|
|
|
452
517
|
}
|
|
453
518
|
/**
|
|
454
519
|
* Function for invoking gamble game
|
|
520
|
+
* @public
|
|
455
521
|
* @returns {Promise<void>} - A promise that resolves when the gamble game is finished.
|
|
456
522
|
*/
|
|
457
523
|
async invokeGambleGame() {
|
|
@@ -475,6 +541,7 @@ export class AbstractMainContainer extends Container {
|
|
|
475
541
|
/**
|
|
476
542
|
* Function for creating the under frame panel.
|
|
477
543
|
* This panel is used in mobile portrait mode to display additional information.
|
|
544
|
+
* @protected
|
|
478
545
|
* @returns {Graphics | Sprite} The under frame panel as a Graphics or Sprite object.
|
|
479
546
|
*/
|
|
480
547
|
createUnderFramePanel() {
|
|
@@ -486,6 +553,7 @@ export class AbstractMainContainer extends Container {
|
|
|
486
553
|
/**
|
|
487
554
|
* Function for enabling mobile portrait mode.
|
|
488
555
|
* It creates the under frame panel, portrait play buttons, and adds them to the container.
|
|
556
|
+
* @public
|
|
489
557
|
* @returns {void}
|
|
490
558
|
*/
|
|
491
559
|
enableForMobile() {
|
|
@@ -502,6 +570,7 @@ export class AbstractMainContainer extends Container {
|
|
|
502
570
|
}
|
|
503
571
|
/**
|
|
504
572
|
* Function for enabling landscape mode.
|
|
573
|
+
* @public
|
|
505
574
|
* @returns {void}
|
|
506
575
|
*/
|
|
507
576
|
enableForLandscape() {
|
|
@@ -511,6 +580,7 @@ export class AbstractMainContainer extends Container {
|
|
|
511
580
|
}
|
|
512
581
|
/**
|
|
513
582
|
* Function for positioning the round win container.
|
|
583
|
+
* @protected
|
|
514
584
|
* @returns {void}
|
|
515
585
|
*/
|
|
516
586
|
positionRoundWinContainer() {
|
|
@@ -525,9 +595,11 @@ export class AbstractMainContainer extends Container {
|
|
|
525
595
|
}
|
|
526
596
|
/**
|
|
527
597
|
* Function for invoking the roulette win plate.
|
|
598
|
+
* @public
|
|
528
599
|
* @param {string} winAnimationName The name of the win animation.
|
|
529
600
|
* @param {WinTypeId} winType The type of win.
|
|
530
601
|
* @param {string} startAnimationName The name of the start animation defaulting to "start".
|
|
602
|
+
* @returns {Promise<void>}
|
|
531
603
|
*/
|
|
532
604
|
async invokeRouletteWinPlate(winAnimationName, winType, startAnimationName = "start") {
|
|
533
605
|
this.rouletteWinContainer = this.createRouletteContainer(startAnimationName);
|
|
@@ -563,6 +635,8 @@ export class AbstractMainContainer extends Container {
|
|
|
563
635
|
}
|
|
564
636
|
/**
|
|
565
637
|
* Function for disabling components for mobile portrait orientation.
|
|
638
|
+
* @public
|
|
639
|
+
* @returns {void}
|
|
566
640
|
*/
|
|
567
641
|
disableForMobile() {
|
|
568
642
|
if (this.logo) {
|
|
@@ -580,6 +654,8 @@ export class AbstractMainContainer extends Container {
|
|
|
580
654
|
}
|
|
581
655
|
/**
|
|
582
656
|
* Function for disabling components for landscape orientation.
|
|
657
|
+
* @public
|
|
658
|
+
* @returns {void}
|
|
583
659
|
*/
|
|
584
660
|
disableForLandscape() {
|
|
585
661
|
if (this.landscapePlayButtons !== null) {
|
|
@@ -592,6 +668,8 @@ export class AbstractMainContainer extends Container {
|
|
|
592
668
|
* Function for resizing the main container and its components.
|
|
593
669
|
* This function removes the current frame and any win containers,
|
|
594
670
|
* resizes the message box, background, animated front,
|
|
671
|
+
* @public
|
|
672
|
+
* @returns {void}
|
|
595
673
|
*/
|
|
596
674
|
resize() {
|
|
597
675
|
this.removeChild(this._frame);
|
|
@@ -628,6 +706,7 @@ export class AbstractMainContainer extends Container {
|
|
|
628
706
|
}
|
|
629
707
|
/**
|
|
630
708
|
* Function for creating the left buttons
|
|
709
|
+
* @protected
|
|
631
710
|
* @returns {LeftButtons} - Returns a new instance of LeftButtons.
|
|
632
711
|
*/
|
|
633
712
|
createLeftButtons() {
|
|
@@ -635,6 +714,7 @@ export class AbstractMainContainer extends Container {
|
|
|
635
714
|
}
|
|
636
715
|
/**
|
|
637
716
|
* Function for creating the right buttons
|
|
717
|
+
* @protected
|
|
638
718
|
* @returns {RightButtons} - Returns a new instance of RightButtons.
|
|
639
719
|
*/
|
|
640
720
|
createRightButtons() {
|
|
@@ -642,6 +722,7 @@ export class AbstractMainContainer extends Container {
|
|
|
642
722
|
}
|
|
643
723
|
/**
|
|
644
724
|
* Function for creating the left buttons for mobile portrait orientation
|
|
725
|
+
* @protected
|
|
645
726
|
* @returns {LeftButtonsMobile} - Returns a new instance of LeftButtonsMobile for mobile portrait orientation.
|
|
646
727
|
*/
|
|
647
728
|
createLeftButtonsMobile() {
|
|
@@ -649,6 +730,7 @@ export class AbstractMainContainer extends Container {
|
|
|
649
730
|
}
|
|
650
731
|
/**
|
|
651
732
|
* Function for creating the right buttons for mobile portrait orientation
|
|
733
|
+
* @protected
|
|
652
734
|
* @returns {RightButtonsMobile} - Returns a new instance of RightButtonsMobile for mobile portrait orientation.
|
|
653
735
|
*/
|
|
654
736
|
createRightButtonsMobile() {
|
|
@@ -691,9 +773,9 @@ export class AbstractMainContainer extends Container {
|
|
|
691
773
|
* It checks the current device orientation and creates the appropriate left and right buttons.
|
|
692
774
|
* It also removes the previous left and right buttons from the container.
|
|
693
775
|
* It resizes the right buttons if the current orientation is "mobile-portrait".
|
|
694
|
-
* @
|
|
695
|
-
* @returns {void}
|
|
776
|
+
* @private
|
|
696
777
|
* @memberof AbstractMainContainer
|
|
778
|
+
* @returns {void}
|
|
697
779
|
*/
|
|
698
780
|
initComponentsForScreenRatio() {
|
|
699
781
|
const currentOrientation = getDeviceOrientation();
|
|
@@ -738,6 +820,8 @@ export class AbstractMainContainer extends Container {
|
|
|
738
820
|
* under frame panel, overlay, big win container, super bonus win container, bonus win container,
|
|
739
821
|
* mystery win container, gamble game, bottom panel, free spin plate, and
|
|
740
822
|
* free spin summary.
|
|
823
|
+
* @private
|
|
824
|
+
* @returns {void}
|
|
741
825
|
*/
|
|
742
826
|
resizeDependentComponents() {
|
|
743
827
|
const resizingHelper = globalMinRatio();
|
|
@@ -804,6 +888,8 @@ export class AbstractMainContainer extends Container {
|
|
|
804
888
|
/**
|
|
805
889
|
* This method is used to refresh the layers in the main container.
|
|
806
890
|
* It removes the existing layers and adds them back in the correct order.
|
|
891
|
+
* @protected
|
|
892
|
+
* @returns {void}
|
|
807
893
|
*/
|
|
808
894
|
refreshLayers() {
|
|
809
895
|
this.removeChild(BackgroundLayer);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Container, TextStyle } from "pixi.js";
|
|
2
|
+
/**
|
|
3
|
+
* Class for creating double border text
|
|
4
|
+
* @class DoubleBorderText
|
|
5
|
+
* @typedef {DoubleBorderText}
|
|
6
|
+
* @augments {Container}
|
|
7
|
+
*/
|
|
8
|
+
export declare class DoubleBorderText extends Container {
|
|
9
|
+
constructor(text: string, outerStyle: () => TextStyle, innerStyle: () => TextStyle);
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Container, Text } from "pixi.js";
|
|
2
|
+
/**
|
|
3
|
+
* Class for creating double border text
|
|
4
|
+
* @class DoubleBorderText
|
|
5
|
+
* @typedef {DoubleBorderText}
|
|
6
|
+
* @augments {Container}
|
|
7
|
+
*/
|
|
8
|
+
export class DoubleBorderText extends Container {
|
|
9
|
+
constructor(text, outerStyle, innerStyle) {
|
|
10
|
+
super();
|
|
11
|
+
const outerStyleData = outerStyle();
|
|
12
|
+
const outerText = new Text(text, outerStyleData);
|
|
13
|
+
outerText.anchor.set(0.5);
|
|
14
|
+
const innerText = new Text(text, innerStyle());
|
|
15
|
+
innerText.anchor.set(0.5);
|
|
16
|
+
this.addChild(outerText);
|
|
17
|
+
this.addChild(innerText);
|
|
18
|
+
if (outerStyleData.dropShadow) {
|
|
19
|
+
const dropShadowDistance = outerStyleData.dropShadowDistance;
|
|
20
|
+
innerText.x -= dropShadowDistance / 2;
|
|
21
|
+
innerText.y -= dropShadowDistance / 2;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DoubleBorderText";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DoubleBorderText";
|
|
@@ -26,11 +26,50 @@ export declare class GambleGame extends Container {
|
|
|
26
26
|
private readonly previousGamblesContainer;
|
|
27
27
|
private previousGambles;
|
|
28
28
|
constructor(cardSpineName: string, resolver: (newBalance: number) => void, lastWinAmount: number, balanceValue: number);
|
|
29
|
+
/**
|
|
30
|
+
* Function for showing previous gamble
|
|
31
|
+
* @private
|
|
32
|
+
* @param {GambleCard[]} previousGambles all of the available cards
|
|
33
|
+
* @returns {void}
|
|
34
|
+
*/
|
|
29
35
|
private showPreviousGambles;
|
|
36
|
+
/**
|
|
37
|
+
* Function for closing gamble game modal
|
|
38
|
+
* This updated also the balance value
|
|
39
|
+
* @private
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
30
42
|
private closeGame;
|
|
43
|
+
/**
|
|
44
|
+
* Function for updating double and win fields
|
|
45
|
+
* @private
|
|
46
|
+
* @param {number} winAmount win amount from gamble
|
|
47
|
+
* @returns {Promise<void>}
|
|
48
|
+
*/
|
|
31
49
|
private updateDoubleAndWinFields;
|
|
50
|
+
/**
|
|
51
|
+
* Function for losing double and win fields
|
|
52
|
+
* @private
|
|
53
|
+
* @returns {Promise<void>}
|
|
54
|
+
*/
|
|
32
55
|
private loseDoubleAndWinFields;
|
|
56
|
+
/**
|
|
57
|
+
* Function for handling gamble play
|
|
58
|
+
* @private
|
|
59
|
+
* @param {GambleCardColor} choice - The color choice for the gamble
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
*/
|
|
33
62
|
private handleGamblePlay;
|
|
63
|
+
/**
|
|
64
|
+
* Function for resizing the gamble game components
|
|
65
|
+
* @public
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
34
68
|
resize(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Function for initializing child positions
|
|
71
|
+
* @private
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
35
74
|
private initChildPositions;
|
|
36
75
|
}
|
|
@@ -62,6 +62,12 @@ export class GambleGame extends Container {
|
|
|
62
62
|
});
|
|
63
63
|
this.resize();
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Function for showing previous gamble
|
|
67
|
+
* @private
|
|
68
|
+
* @param {GambleCard[]} previousGambles all of the available cards
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
65
71
|
showPreviousGambles(previousGambles) {
|
|
66
72
|
const { width } = RainMan.app.screen;
|
|
67
73
|
this.previousGambles.forEach((gambleCard) => this.previousGamblesContainer.removeChild(gambleCard));
|
|
@@ -77,19 +83,44 @@ export class GambleGame extends Container {
|
|
|
77
83
|
this.previousGamblesContainer.y =
|
|
78
84
|
this.previousGamblesText.y + this.previousGamblesText.height + this.previousGamblesContainer.height / 2;
|
|
79
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Function for closing gamble game modal
|
|
88
|
+
* This updated also the balance value
|
|
89
|
+
* @private
|
|
90
|
+
* @returns {void}
|
|
91
|
+
*/
|
|
80
92
|
closeGame() {
|
|
81
93
|
RainMan.componentRegistry.get(BUTTONS.gamble).flipDisabledFlag(true);
|
|
82
94
|
this.resolver(this.balanceValue);
|
|
83
95
|
}
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Function for updating double and win fields
|
|
98
|
+
* @private
|
|
99
|
+
* @param {number} winAmount win amount from gamble
|
|
100
|
+
* @returns {Promise<void>}
|
|
101
|
+
*/
|
|
102
|
+
async updateDoubleAndWinFields(winAmount) {
|
|
103
|
+
return Promise.all([this.gambleWin.update(winAmount), this.currentWin.update(winAmount / 2)]);
|
|
86
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Function for losing double and win fields
|
|
107
|
+
* @private
|
|
108
|
+
* @returns {Promise<void>}
|
|
109
|
+
*/
|
|
87
110
|
async loseDoubleAndWinFields() {
|
|
111
|
+
RainMan.settingsStore.disableSpecialButtons();
|
|
88
112
|
return Promise.all([this.gambleWin.loseUpdate(), this.currentWin.loseUpdate()]);
|
|
89
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Function for handling gamble play
|
|
116
|
+
* @private
|
|
117
|
+
* @param {GambleCardColor} choice - The color choice for the gamble
|
|
118
|
+
* @returns {Promise<void>}
|
|
119
|
+
*/
|
|
90
120
|
async handleGamblePlay(choice) {
|
|
91
|
-
if (this.lastWinAmount === 0)
|
|
121
|
+
if (this.lastWinAmount === 0) {
|
|
92
122
|
return;
|
|
123
|
+
}
|
|
93
124
|
this.redButton.flipDisabledFlag(true);
|
|
94
125
|
this.blackButton.flipDisabledFlag(true);
|
|
95
126
|
this.card.state.addAnimation(0, "wait", true, 0);
|
|
@@ -121,6 +152,11 @@ export class GambleGame extends Container {
|
|
|
121
152
|
]);
|
|
122
153
|
}
|
|
123
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Function for resizing the gamble game components
|
|
157
|
+
* @public
|
|
158
|
+
* @returns {void}
|
|
159
|
+
*/
|
|
124
160
|
resize() {
|
|
125
161
|
const { width, height } = RainMan.app.screen;
|
|
126
162
|
this.x = 0;
|
|
@@ -129,6 +165,11 @@ export class GambleGame extends Container {
|
|
|
129
165
|
this.height = height;
|
|
130
166
|
this.initChildPositions();
|
|
131
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Function for initializing child positions
|
|
170
|
+
* @private
|
|
171
|
+
* @returns {void}
|
|
172
|
+
*/
|
|
132
173
|
initChildPositions() {
|
|
133
174
|
this.removeChild(this.background);
|
|
134
175
|
this.removeChild(this.frame);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { TextureMap } from "..";
|
|
2
|
+
/**
|
|
3
|
+
* Type for mapping textures used in the gamble game
|
|
4
|
+
* This includes all buttons and card textures
|
|
5
|
+
* @typedef {GambleGameTextureMaps}
|
|
6
|
+
*/
|
|
2
7
|
export type GambleGameTextureMaps = {
|
|
3
8
|
halveButton: TextureMap;
|
|
4
9
|
collectButton: TextureMap;
|