Slot Machine Prototype v2
This prototype is based on setting profiles. A scriptable object holds all the game settings. This allows us to change settings, graphics, and behaviors easily, even in play mode.
To create new settings, right-click in the project, select Create, then Settings.
The first tab in the settings profile is Resources. In this tab, we define our slot resources (type, background, and icon).
This tab is where we define the spinning behavior of each profile.
This is where we set paylines. We can also draw the payline on the screen and set an identity color for each one.
This tab allows us to control the slot machine layout by changing slots scale or adjusting the spacing on the vertical/horizontal axis.
In this prototype, a different approach was used to make spinning smoother and more flexible. We translate the whole reel one step down and then return it to the start position after shifting the slot and generating a new one on the top, creating a full cycle.
After the spin is completed, we need to clamp the reel to the appropriate position. We compare the reel position with the top (start pos) and bottom (pos of the next step) and move to the shortest distance between them.