Slot Machine Prototype v2
- Settings Profile: The prototype based on settings profiles which a scriptable object holds all the settings of the game. the benefits from that it's allow us to change settings, graphics and behaviors in one shot even in the play mode.
to create a new settings just Right Click in project -> Create -> Settings
- Settings Resources: the first tab in the settings profile is Resources. in this tab we need to fill our slot resources (type / background and icon).
- Spin Settings: All the magic happen in this tab, from it we can create a lot of spinning variation for each profile.
- Paylines: It's a cool method to set paylines into the machine. we can also draw the payline on the screen set an identity color for each one.
- Layout: This tab allow us to control the slot machine layout by changing slots scale or adjust the spacing on the vertical/horizontal axis.
- Spinning:
In this prototype i used a different approach to make the spinning smooth and more flexibility to work with it. the picture below appears that we translate the whole reel one step down. and then return it the start position after shifting the slot and generate new one on the top. to create a full cycle.
- Clamping:
After the spin complete we need to clamp the reel to appropriate position. so we just compare the reel position with the top (start pos) and bottom (pos of the next step) and move to the shortest distance between them.