2 |
3 |
4 |
61 |
--------------------------------------------------------------------------------
/assets/images/UI/buttons/bet_down_button_hover.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
75 |
--------------------------------------------------------------------------------
/code/client/src/UI/bottomBar/BottomBar.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useImperativeHandle, useRef, useEffect } from "react";
2 | import "./CSS/BottomBar.css";
3 | import gsap from 'gsap';
4 | import BetLabel from './betLabel/BetLabel.jsx';
5 | import Balance from './balance/Balance.jsx'
6 | import Options from './options/Options.jsx'
7 |
8 | const BottomBar = React.forwardRef((props, ref) => {
9 | const [state, setState] = useState({
10 | bottom: '0px',
11 | height: 100
12 | });
13 | const bottomBarRef = useRef(null);
14 | const betLabelRef = useRef(null);
15 | const balanceRef = useRef(null);
16 |
17 | const update = (newData) => {
18 | betLabelRef.current.update(newData)
19 | balanceRef.current.update(newData.credits)
20 | }
21 |
22 | const updateBalanceValue = (newValue) => {
23 | balanceRef.current.update(newValue)
24 | }
25 |
26 | const getBalanceValue = () => {
27 | return balanceRef.current.getValue()
28 | }
29 |
30 | const getBetValue = () => {
31 | return betLabelRef.current.getBetValue()
32 | }
33 |
34 | const hasSufficientBalanceForSpin = (balance) => {
35 | return betLabelRef.current.hasSufficientBalance(balance)
36 | }
37 |
38 | const calculateAndUpdateBalance = (betValue) => {
39 | return balanceRef.current.calculateAndUpdateBalance(betValue)
40 | }
41 |
42 | useEffect(() => {
43 | window.addEventListener('resize', onResize);
44 | return () => window.removeEventListener('resize', onResize);
45 | }, []);
46 |
47 | const resize = (resizeData) => {
48 | setState((prevState) => ({
49 | ...prevState,
50 | ...resizeData
51 | }));
52 | };
53 |
54 | const getHeight = () => {
55 | return state.height
56 | }
57 |
58 | const startOpenTween = () => {
59 | gsap.fromTo(
60 | bottomBarRef.current,
61 | { scale: 0 },
62 | { scale: 1, ease: "back.out", duration: 1 })
63 | }
64 |
65 | const onResize = () => {
66 |
67 | }
68 |
69 | useImperativeHandle(ref, () => ({
70 | resize,
71 | getHeight,
72 | startOpenTween,
73 | hasSufficientBalanceForSpin,
74 | calculateAndUpdateBalance,
75 | getBetValue,
76 | updateBalanceValue,
77 | update,
78 | getBalanceValue
79 | }));
80 |
81 | return (
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | );
94 | });
95 |
96 | export default BottomBar;
97 |
--------------------------------------------------------------------------------
/code/client/src/pages/Pages.jsx:
--------------------------------------------------------------------------------
1 | import React, { useRef, useState, useImperativeHandle } from 'react';
2 | import "./CSS/Pages.css";
3 | import LoadingScreen from "./loadingScreen/LoadingScreen";
4 | import LoginScreen from "./loginScreen/LoginScreen";
5 | import LoadingGame from "./loadingGame/LoadingGame";
6 | import GameInformation from "./gameInformation/GameInformation";
7 |
8 | const Pages = React.forwardRef((props, ref) => {
9 | const [responsiveState, setResponsiveState] = useState({
10 | width: '0px',
11 | height: '0px',
12 | left: '0px',
13 | top: '0px',
14 | transform: 'none',
15 | display: 'none'
16 | });
17 | const [active, setActive] = useState(true);
18 | const [loadingScreenVisible, setLoadingScreenVisible] = useState(false);
19 | const [loginScreenVisible, setLoginScreenVisible] = useState(false);
20 | const [loadingGameVisible, setLoadingGameVisible] = useState(true);
21 | const [gameInformationVisible, setGameInformationVisible] = useState(false);
22 |
23 | const loadingScreenRef = useRef(null);
24 | const loginScreenRef = useRef(null);
25 | const loadingGameRef = useRef(null);
26 | const gameInformationRef = useRef(null);
27 |
28 | const handleLoadingPageVisible =(value) => {
29 | setLoadingScreenVisible(value);
30 | }
31 |
32 | const handleGameInformationVisible = async (value) => {
33 | setGameInformationVisible(value);
34 | setPointerEventActive(true)
35 | }
36 |
37 | const handleLoginPageVisible = (value) => {
38 | setLoginScreenVisible(value);
39 | }
40 |
41 | const handleLoadingGameVisible = (value) => {
42 | setLoadingGameVisible(value)
43 | }
44 |
45 | const handleLobbyPageVisible = (value) => {
46 | if(value === false) lobbyScreenRef.current.removeListeners()
47 | setLobbyScreenVisible(value)
48 | }
49 |
50 | const resize = (resizeData) => {
51 | setResponsiveState(resizeData);
52 | }
53 |
54 | const setPointerEventActive = (value) => {
55 | setActive(value)
56 | }
57 |
58 | useImperativeHandle(ref, () => ({
59 | handleLoadingPageVisible,
60 | handleLoginPageVisible,
61 | handleLoadingGameVisible,
62 | handleLobbyPageVisible,
63 | setPointerEventActive,
64 | handleGameInformationVisible,
65 | resize
66 | }));
67 | const { width, height, left, top, transform, display } = responsiveState
68 | const style = { width, height, left, top, transform, display };
69 |
70 | return (
71 |
72 | {loadingGameVisible && }
73 | {loginScreenVisible && }
74 | {loadingScreenVisible && }
75 | {gameInformationVisible && }
76 |
77 | );
78 | });
79 |
80 | export default Pages;
--------------------------------------------------------------------------------
/assets/images/UI/buttons/information_button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
83 |
--------------------------------------------------------------------------------
/assets/images/loading_game_anim.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/UI/buttons/hamburger_button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
60 |
--------------------------------------------------------------------------------
/assets/engine.io-parser-BiEtp6m2.js:
--------------------------------------------------------------------------------
1 | const s=Object.create(null);s.open="0";s.close="1";s.ping="2";s.pong="3";s.message="4";s.upgrade="5";s.noop="6";const w=Object.create(null);Object.keys(s).forEach(e=>{w[s[e]]=e});const p={type:"error",data:"parser error"},U=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",T=typeof ArrayBuffer=="function",C=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,m=({type:e,data:n},r,t)=>U&&n instanceof Blob?r?t(n):b(n,t):T&&(n instanceof ArrayBuffer||C(n))?r?t(n):b(new Blob([n]),t):t(s[e]+(n||"")),b=(e,n)=>{const r=new FileReader;return r.onload=function(){const t=r.result.split(",")[1];n("b"+(t||""))},r.readAsDataURL(e)};function B(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let g;function P(e,n){if(U&&e.data instanceof Blob)return e.data.arrayBuffer().then(B).then(n);if(T&&(e.data instanceof ArrayBuffer||C(e.data)))return n(B(e.data));m(e,!1,r=>{g||(g=new TextEncoder),n(g.encode(r))})}const E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let n=e.length*.75,r=e.length,t,f=0,o,c,a,i;e[e.length-1]==="="&&(n--,e[e.length-2]==="="&&n--);const l=new ArrayBuffer(n),u=new Uint8Array(l);for(t=0;t>4,u[f++]=(c&15)<<4|a>>2,u[f++]=(a&3)<<6|i&63;return l},V=typeof ArrayBuffer=="function",R=(e,n)=>{if(typeof e!="string")return{type:"message",data:D(e,n)};const r=e.charAt(0);return r==="b"?{type:"message",data:x(e.substring(1),n)}:w[r]?e.length>1?{type:w[r],data:e.substring(1)}:{type:w[r]}:p},x=(e,n)=>{if(V){const r=S(e);return D(r,n)}else return{base64:!0,data:e}},D=(e,n)=>{switch(n){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},O="",v=(e,n)=>{const r=e.length,t=new Array(r);let f=0;e.forEach((o,c)=>{m(o,!1,a=>{t[c]=a,++f===r&&n(t.join(O))})})},L=(e,n)=>{const r=e.split(O),t=[];for(let f=0;f{const t=r.length;let f;if(t<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,t);else if(t<65536){f=new Uint8Array(3);const o=new DataView(f.buffer);o.setUint8(0,126),o.setUint16(1,t)}else{f=new Uint8Array(9);const o=new DataView(f.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(t))}e.data&&typeof e.data!="string"&&(f[0]|=128),n.enqueue(f),n.enqueue(r)})}})}let A;function d(e){return e.reduce((n,r)=>n+r.length,0)}function h(e,n){if(e[0].length===n)return e.shift();const r=new Uint8Array(n);let t=0;for(let f=0;fMath.pow(2,21)-1){a.enqueue(p);break}f=u*Math.pow(2,32)+l.getUint32(4),t=3}else{if(d(r)e){a.enqueue(p);break}}}})}const _=4;export{L as a,m as b,q as c,R as d,v as e,j as f,_ as p};
2 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 | Slot Machine
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/assets/images/UI/buttons/bet_up_button_hover.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
96 |
--------------------------------------------------------------------------------
/assets/images/UI/buttons/sound_off_button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
63 |
--------------------------------------------------------------------------------
/assets/scheduler-CzFDRTuY.js:
--------------------------------------------------------------------------------
1 | var H={exports:{}},J={};/**
2 | * @license React
3 | * scheduler.production.min.js
4 | *
5 | * Copyright (c) Facebook, Inc. and its affiliates.
6 | *
7 | * This source code is licensed under the MIT license found in the
8 | * LICENSE file in the root directory of this source tree.
9 | */(function(l){function P(n,e){var t=n.length;n.push(e);n:for(;0>>1,r=n[i];if(0>>1;ih(N,t))bh(I,N)?(n[i]=I,n[b]=t,i=b):(n[i]=N,n[v]=t,i=v);else if(bh(I,t))n[i]=I,n[b]=t,i=b;else break n}}return e}function h(n,e){var t=n.sortIndex-e.sortIndex;return t!==0?t:n.id-e.id}if(typeof performance=="object"&&typeof performance.now=="function"){var K=performance;l.unstable_now=function(){return K.now()}}else{var R=Date,O=R.now();l.unstable_now=function(){return R.now()-O}}var f=[],c=[],Q=1,a=null,u=3,m=!1,s=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(n){for(var e=o(c);e!==null;){if(e.callback===null)_(c);else if(e.startTime<=n)_(c),e.sortIndex=e.expirationTime,P(f,e);else break;e=o(c)}}function E(n){if(y=!1,T(n),!s)if(o(f)!==null)s=!0,M(C);else{var e=o(c);e!==null&&F(E,e.startTime-n)}}function C(n,e){s=!1,y&&(y=!1,B(d),d=-1),m=!0;var t=u;try{for(T(e),a=o(f);a!==null&&(!(a.expirationTime>e)||n&&!A());){var i=a.callback;if(typeof i=="function"){a.callback=null,u=a.priorityLevel;var r=i(a.expirationTime<=e);e=l.unstable_now(),typeof r=="function"?a.callback=r:a===o(f)&&_(f),T(e)}else _(f);a=o(f)}if(a!==null)var w=!0;else{var v=o(c);v!==null&&F(E,v.startTime-e),w=!1}return w}finally{a=null,u=t,m=!1}}var k=!1,p=null,d=-1,q=5,z=-1;function A(){return!(l.unstable_now()-zn||125i?(n.sortIndex=t,P(c,n),o(f)===null&&n===o(c)&&(y?(B(d),d=-1):y=!0,F(E,t-i))):(n.sortIndex=r,P(f,n),s||m||(s=!0,M(C))),n},l.unstable_shouldYield=A,l.unstable_wrapCallback=function(n){var e=u;return function(){var t=u;u=e;try{return n.apply(this,arguments)}finally{u=t}}}})(J);H.exports=J;var U=H.exports;export{U as s};
10 |
--------------------------------------------------------------------------------
/code/client/src/game/scenes/Preload.ts:
--------------------------------------------------------------------------------
1 | import {Assets} from "pixi.js";
2 | import AudioManager from "../../managers/AudioManager";
3 | import ImageManager from "../../managers/ImageManager";
4 | import BaseScene from "../abstraction/BaseScene";
5 | import symbolTypes from "../../game/machine/config/symbolTypes";
6 | import loadAudioData from "../../../public/assets/audio/loadAudioData.json";
7 | import {ASSETS_CONFIG} from "../../config/assetsConfig";
8 | import PagesManager from '../../pages/manager/PagesManager.js';
9 |
10 | class Preload extends BaseScene {
11 | constructor() {
12 | super("Preload");
13 | }
14 |
15 | override async init(){
16 | await this.loadAllAudio()
17 | await this.loadResponsiveImages()
18 | await this.loadSymbolsAtlases()
19 | await this.loadMatchFrames()
20 | await this.loadBackgroundFrames()
21 | await this.loadMatchLineImages()
22 | await this.loadFonts()
23 | // await this.loadSpineAnimation()
24 | this.handleStartNextScene();
25 | }
26 |
27 | private async loadAllAudio() {
28 | await Object.entries(loadAudioData).forEach(async ([_key, audioData]) => {
29 | await this.loadAudio(audioData);
30 | });
31 | }
32 |
33 | // private async loadSpineAnimation(){
34 | // const key = "eagle"
35 | // let source = await Assets.load(
36 | // `assets/images/${key}.json`
37 | // );
38 | // ImageManager.addImage(key, source);
39 | // }
40 |
41 |
42 | private async loadAudio({path, key, settings}: {path: string, key: string, settings:{ loop: boolean, volume: number}}) {
43 | const {_path, extension} = ASSETS_CONFIG.audio
44 | let source = _path + path + "/" + key + extension
45 | await AudioManager.addAudio(key, source, settings);
46 | }
47 |
48 | private async loadFonts(){
49 | await Assets.load(
50 | `https://pixijs.com/assets/bitmap-font/desyrel.xml`
51 | );
52 | }
53 |
54 | private async loadResponsiveImages(){
55 | const images = [
56 | "symbols_bg",
57 | "credits_counter_shine",
58 | "symbol_describe_label",
59 | "game_name_logo_landscape",
60 | "game_name_logo_portrait",
61 | "dark_screen",
62 | "feather",
63 | "credits_counter_background",
64 | ];
65 | let totalImages = images.length;
66 | for (let i = 0; i < totalImages; i++) {
67 | let image = images[i];
68 | let source = await Assets.load(
69 | `assets/images/${image}.png`
70 | );
71 | ImageManager.addImage(image, source);
72 | }
73 | }
74 |
75 | private async loadSymbolsAtlases() {
76 | const symbolAtlasName = symbolTypes
77 | let totalImages = symbolAtlasName.length;
78 | for (let i = 0; i < totalImages; i++) {
79 | let key = symbolAtlasName[i];
80 | let source = await Assets.load(
81 | `assets/images/game/symbols/${key}.json`
82 | );
83 | ImageManager.addImage(key, source);
84 | }
85 | }
86 |
87 | private async loadMatchFrames() {
88 | const symbolAtlas = [
89 | "fire_frame", //0
90 | ];
91 | let totalImages = symbolAtlas.length;
92 | for (let i = 0; i < totalImages; i++) {
93 | let key = symbolAtlas[i];
94 | let source = await Assets.load(
95 | `assets/images/game/matching/frames/${key}.json`
96 | );
97 | ImageManager.addImage(key, source);
98 | }
99 | }
100 |
101 | private async loadBackgroundFrames(){
102 | const images = ["background", "background_overlay"]
103 | let totalImages = images.length;
104 | for (let i = 0; i < totalImages; i++) {
105 | let key = images[i];
106 | let source = await Assets.load(
107 | `assets/images/game/background/${key}.json`
108 | );
109 | ImageManager.addImage(key, source);
110 | }
111 | }
112 |
113 | private async loadMatchLineImages(){
114 | const key = "matchLinesAtlas"
115 | let source = await Assets.load(
116 | `assets/images/game/matching/lines/${key}.json`
117 | );
118 | ImageManager.addImage(key, source);
119 | }
120 |
121 | private handleStartNextScene(){
122 | PagesManager.handleLoginPageVisible(true)
123 | }
124 |
125 | }
126 |
127 | export default new Preload()
--------------------------------------------------------------------------------
/assets/images/UI/buttons/sound_on_button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
68 |
--------------------------------------------------------------------------------
/code/client/src/game/machine/creditsCounter/controller/CreditsCounterController.ts:
--------------------------------------------------------------------------------
1 | import CreditsCounterModel from "../model/CreditsCounterModel";
2 | import CreditsCounterView from "../view/CreditsCounterView";
3 | import Container from "../../../components/Container";
4 | import AudioManager from "../../../../managers/AudioManager";
5 | import gsap from "gsap";
6 |
7 | export default class BetLabelController {
8 | protected _model: CreditsCounterModel;
9 | protected _view: CreditsCounterView;
10 | protected _scene: Container;
11 | protected countCreditsTween: any;
12 | protected scaleUpTween: any;
13 | protected scaleDownTween: any;
14 | protected counterPromise: any;
15 | protected showCreditsPromise: any;
16 |
17 | constructor(scene: Container, model: CreditsCounterModel, view: CreditsCounterView) {
18 | this._scene = scene
19 | this._model = model;
20 | this._view = view;
21 | this._scene.alpha = 0
22 |
23 | this.counterPromise = null
24 | this.showCreditsPromise = null
25 | this.countCreditsTween = null
26 | this.scaleUpTween = null
27 | this.scaleDownTween = null
28 | }
29 |
30 | public async startCounter(credits: number){
31 | // if(credits == 0) return//@ts-ignorets
32 | this.setScale(1.3)
33 | await new Promise(resolve => {
34 | this.counterPromise = resolve
35 | this.setViewVisible(true)
36 | this._scene.alpha = 1
37 | this.startScaleUpViewTween()
38 | this.startCountCreditsTween(credits, resolve)
39 | AudioManager.playAudio("credits_count")
40 | AudioManager.playAudio("count_loop")
41 | })
42 | }
43 |
44 | public async showCreditCount(credits: number){
45 | this.setScale(0.9)
46 | // this.setViewVisible(true)
47 | this._scene.alpha = 0//@ts-ignorets
48 | this.updateCreditsText(credits.toFixed(2))
49 |
50 | await new Promise(resolve => {
51 | this.showCreditsPromise = resolve
52 | gsap.to( this._scene, {
53 | duration: 0.6,
54 | alpha: 1,
55 | ease: 'back.out',
56 | onComplete:() =>{
57 | this.startHideTween(resolve)
58 | }
59 | });
60 | })
61 | }
62 |
63 | private startHideTween(resolve){
64 | gsap.to(this._scene, {
65 | duration: 0.6,
66 | delay:1,
67 | alpha:0,
68 | ease: 'back.out',
69 | onComplete:() =>{
70 | // this.setViewVisible(false)
71 | resolve(0)
72 | }
73 | });
74 | }
75 |
76 | public hideCreditCount(){
77 | this.setViewVisible(false)
78 | }
79 |
80 | private startCountCreditsTween(credits: number, resolve: any){
81 | const startValue = { value: 0 }
82 | this.countCreditsTween = gsap.to(startValue, {
83 | value: credits,
84 | duration: 2,
85 | ease: 'power4.out',
86 | onUpdate: ()=>{
87 | const newValue = startValue.value.toFixed(2)//@ts-ignorets
88 | this.updateCreditsText(newValue)
89 | },
90 | onComplete:() =>{
91 | this.startScaleDownViewTween(resolve)
92 | }
93 | });
94 | }
95 |
96 | private startScaleUpViewTween(){
97 | this.setScale(0.1)
98 | this.scaleUpTween = gsap.to( this._scene.scale, {
99 | duration: 0.8,
100 | x:1.1,
101 | y:1.1,
102 | ease: 'back.out',
103 | });
104 | }
105 |
106 | private startScaleDownViewTween(resolve){
107 | this.setScale(1.1)
108 | this.scaleDownTween = gsap.to(this._scene.scale, {
109 | duration: 0.5,
110 | x: 0.1,
111 | y: 0.1,
112 | ease: 'back.in',
113 | onComplete:() =>{
114 | // this.setViewVisible(false)
115 | this.setScale(0.9)
116 | this._scene.alpha = 1
117 | resolve(0)
118 | }
119 | });
120 | }
121 |
122 | private setViewVisible(value: boolean){
123 | this._scene.visible = value
124 | }
125 | //@ts-ignorets
126 | private updateCreditsText(newText: number){//@ts-ignorets
127 | this._view.creditsText.text = newText
128 | }
129 |
130 | private setScale(value: number){
131 | this._scene.scale.x = value
132 | this._scene.scale.y = value
133 | }
134 |
135 | public stopTweens(){
136 | if(this.counterPromise) this.counterPromise()
137 | if(this.showCreditsPromise) this.showCreditsPromise()
138 | if(this.countCreditsTween) this.countCreditsTween.pause()
139 | if(this.scaleUpTween) this.scaleUpTween.pause()
140 | if(this.scaleDownTween) this.scaleDownTween.pause()
141 | this.countCreditsTween = null
142 | this.scaleUpTween = null
143 | this.scaleDownTween = null
144 | }
145 |
146 | }
147 |
--------------------------------------------------------------------------------
/assets/socket.io-parser-BBkuslX-.js:
--------------------------------------------------------------------------------
1 | import{E as N}from"./@socket.io-Dkula2eQ.js";const A=typeof ArrayBuffer=="function",E=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,y=Object.prototype.toString,d=typeof Blob=="function"||typeof Blob<"u"&&y.call(Blob)==="[object BlobConstructor]",g=typeof File=="function"||typeof File<"u"&&y.call(File)==="[object FileConstructor]";function a(e){return A&&(e instanceof ArrayBuffer||E(e))||d&&e instanceof Blob||g&&e instanceof File}function u(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num
--------------------------------------------------------------------------------