Well, to be honest, it’s not that onerous to outline the positions of the slot machine, that ar a part of the road, or to examine if there are matching symbols on it positions. The half that’s a touch difficult, is a way to show the user that he won on a line, what quantity he has won, and that symbols on it line ar to blame for the win.
It is attainable to alter the symbols within the slot machine to show them as winners, however all the changes of a logo among the slot machine might also affects the slot machine itself. this can be particularly problematic if you modify the dimension or height of AN item among the machine, as all the animations and also the positioning of the symbols ar supported the idea that every one the things ar constant size. additionally, we wish to draw the winning line higher than the complete slot machine part, however show the symbols that won as a region of the road.
Each winning line is displayed higher than the slot machine and contains the winning symbols and also the win quantity.
That is why we can’t create any changes to the machine itself. we have a tendency to ar aiming to show the road higher than the slot machine and dynamically draw the symbols that compose the road whenever a win happens. And to high all of that, the road itself and also the symbols we have a tendency to draw, ought to absolutely work higher than the machine, that includes a completely different size on each device.
Your brain hurts already? do not be afraid, we have a tendency to ar aiming to add all of this gradual till everything works the method we wish it to. There ar 2 main issues to solve:
How will we have a tendency to show the lines absolutely higher than the slot machine?
How will we dynamically add winning symbols to the line?
The first question could not be answered easier: we have a tendency to already created the photographs for every line in an exceedingly method that completely fits the slot machine. this can be one thing we have a tendency to took care of throughout the look of the sport. If the image of a line has constant height because the machine, the road is absolutely aligned and fits the rows and columns of the slot machine.
We add the code for the validator part below the slot machine part of the scene, therefore the lines ar shown higher than the slot machine. we have a tendency to additionally set the scale of the validator part to suit the machine. the peak of the validator ought to match the slot machine height. we have a tendency to then calculate the dimension supported width/height-ratio of our line pictures. All the lines of the validator deplete the complete validator size, and therefore additionally work the slot machine. when we have a tendency to begin the slot machine, we have a tendency to reset the validator to cover all the lines. once a spin has all over, we have a tendency to decision the validateperform to examine if the player has won. And if he wins, we have a tendency to show the winning lines.
As of now, whenever we have a tendency to cut back the credit quantity to begin the slot machine , or once we increase it just in case of a win, we are able to watch the number amendment over time. we have a tendency to base the period for this animation on the present bet quantity. The animations for the next bet, that additionally cause higher wins, can take longer. The animation period in our case spans from two hundred ms to a thousand ms for the bet amounts of four to twenty.