Slot Machine Pseudocode
Create 3 spinners
Create 3 Stop buttons
Create a lever
Create 3 arrays of 5 symbols each
Create Payline
Create money = $100
Create Cashout button
Assign each array to each spinner
While (money != 0){
On enter frame {
If lever is pulled {
While not all Stop buttons are pushed{
For(i goes from 0 to 3){
For(j goes from 0 to 5){
Array[i].symbol[j] moves across the spinner window
}
}
If Stop button[k] is pushed {
stop Array[k]
check hit test with Payline
mark that symbol as open
}
}
when all Stop buttons are pushed{
for(i goes from 0 to 3){
if all open symbols are the same
money += 10
else
money -= 10
}
If Cashout is pressed
game over, You Win!
Else if money = 0
game over, You Lose!
}