https://github.com/muke1908/slot-machine-demo
https://github.com/muke1908/slot-machine-demo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/muke1908/slot-machine-demo
- Owner: muke1908
- Created: 2020-05-06T00:11:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-24T02:30:57.000Z (about 2 years ago)
- Last Synced: 2025-02-01T19:45:03.605Z (about 1 year ago)
- Language: JavaScript
- Size: 1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
DEMO: https://muke1908.github.io/slot-machine-demo/
## Slot Machine
This is a slot machine implementation having following features:
- Configurable reels (`./config/slot`, `./config/reel`)
- Supports bias in each reel.
- Configurable pay tables (`./config/paytable`)
- Balance indicator.
- Debug mode - debug mode will allow you to set a *symbol* at any position in each *reel*. However, the wining combination will be decided based on the pay table configuration.
## Configs
1. **Reel** - `/config/reel.js`
| Variables | Description | Type |
|----------|-------------|------|
| `symbols` | Array of symbols in a reel | `[{symbol, image}]` |
2. **Slot** - `/config/slot.js`
| Variables | Description | Type |
|----------|-------------|------|
| `slotSpeed` | No of symbol/sec while spinning | `Number` |
| `reelSpinDelay` | Delay in stopping spins from left to right | `Number` |
| `winningLabels` | Winning labels in their vertical order | `Array` |
| `spinDuration` | Spin duration in seconds | `Number` |
| `reelsCount` | No of reels in slot | `Number` |
| `slotBias` | Add bias for each reel while picking random symbol | [Array] |
3. **Pay Table** - `/config/payTable.js`
| Variables | Description | Type |
|----------|-------------|------|
| `spinCost` | No of coin required for each spin | Number |
| `winningCombination` | The combination that defines wining line and winning amount | `Array` |
**NOTE:** Pay table supports any types (horizontal) of winning combinations. The final result will consider the **order** of combination in the table - *Winning combination will be the first matched combination in pay table*
4. **Player** - `/config/user.js`
| Variables | Description | Type |
|----------|-------------|------|
| `initialBalance` | Balance to start session with | `Number` |
| `maxReloadAmount` | Max amount to reload at once | `Number` |
| `minReloadAmount` | Min amount to reload at once | `Number` |
## Start the app
```npm start```