Hi!
So i’m trying to see if I can create a slot machine game, think Luck Be A Landlord.
So I have a 4x5 grid and I want every item to be placed in a random slot on the grid when the “Spin” button is pressed. I have got it almost working. When I press the "Spin’’ button, most objects indeed move to a slot. However, some items simply refuse to do this.
I’m not sure if I’m using the ‘While’ function correctly here. What I would like to achieve is that when it selects a slot that is already filled, it would select another slot until an empty slot is found.
The logic isn’t quite right. Why are you placing the symbol around the slot instead of just placing it at an x & y position?
As for the last event, those conditions are redundent. With the symbol placed at an angle and distance of 0, it’ll always collide with the slot, and Placed will always be false because of the while condition.
I’d suggest doing the following:
Use a normal event with the 2 conditions “Spin is pressed” and a “Trigger once”.
Under that add a subevent that repeats for each symbol, with conditions “Boolean Filled of slot is false”
And under that subevent, and another subevent with a “Pick random slot” as the condition, and place the symbol in that slot.