slotGame
How to use:
- Open cmd, cd to a folder where you want to put the code
- git init
- git pull https://github.com/XBLDev/slotGame.git
- In cmd, run: npm install http-server -g, this will install http-server, which is required to run pixijs
- After installing http-server, in cmd, run: http-server -p 8088
- Open web browser, type in: http://127.0.0.1:8088
Simple description of classes, I have some of the classes that are not really used but I forgot to delete them when I uploaded them on Friday, if a class is not included below then it's probably not used:
GameLogic:
- GameValueManager: it contains all the values that the game needs: the meter values, the currently visible reel numbers etc. For basically each value there's a get/set function. Meters get their values from this class, reels update their visible symbols from this class, and "GameLogic" + "buttonFunctions" update the values in this class.
- GameLogic: it calculates the win values and displays the win lines after each spinning. Use winValues to calculate win values.
- LinePatterns: contains information of all line patterns, including line pattern positions in each reel, each line color etc. A class just for information.
- winValues: win values for each symbol. A class just for information.
- LinePatternBackground: class for creating each line pattern, use LinePatterns in constructor. Update its own visibility using GameValueManager.
- LinePatternAllBackGround: class for fast line pattern generation(instead of generating 5 different LinePatternBackgrounds on 5 different lines)
Visual Elements:
- Reel: class for generating each reel, updates its visible symbols using GameValueManager
- ReelLayouts: class that contains reel layout information, including symbol names, symbol layouts.
- Reels: class for fast reels generation.
- ReelSymbolTransform: contains width, height of each symbol, and start X,Y positions for the left top corner symbol, used by reels in their constructors.
- SimpleSymbol: one symbol in a reel, a PIXI.Sprite.
- SlotSymbolImageURLs: contains image paths, used by Reel in constructor.
ConsoleElements:
- Button: Button class, gets its onClick function from ButtonFunctions class.
- ButtonFunctions: contains all the button functions.
- ButtonTransforms: contains transform information for each button, used by Button in constructor.
- Meter: Meter class, gets its updated value from GameValueManager.
- MeterTransform: contains transform information for each meter, used by Meter in constructor.
Issues(8/06/2017):
- The OOP implementation is not "strict" enough, at least some of the classes can be smaller/split into more classes.
- On Android, it won't react to touch, and the image I use for ACE won't show.
- I run out of time so I didn't do the sound on click/win part.
- Should put some comments in my code.
- Some game functions are rather simple implementations rather than well made functions/algorithms, due to time limit.
Issues(6/06/2017):
- I've been just rushing to get PixiJS working since i've never used it before, so no time to split the whole thing into classes yet. And no time to clean up the code.
- UI positions are all hard-coded.
- I don't know how to put it on android yet, looked around but didn't find easy-to-use mannual on that. It's supposed to be easy enough though.
- Don't know how far I can get with "strict OOP", not really sure how "strict" is strict
- Game logic could be flawed since I don't know much about slot games.