I'm making a Simon says mini game and for it I'm using function calls and arrays. It's working well, except that the new sequence it shows you to follow doesn't go in order, instead all the buttons it asks to press are lit at the same time. I've found that the problem lies in one of my functions which has a for each x in array loop that doesn't do one by one but activates almost immediately. Any Ideas how to fix it?
It does the for each X in one tick so the wait won't work, you can set it up differently to this with 'repeat'. Also why pass the array value through a global variable? You can just say if stateID = array.curvalue.
Thanks!, I've changed it to a repeat and set it to the width of my PlaceHolder Array. It works the same as before, but that's still the problem, the buttons don't follow a sequence, they're turn on all at the same time! how do I slow down the repeat so each button turns on one after the other in a sequence?
Develop games in your browser. Powerful, performant & highly capable.
Never mind! found the answer here https://www.scirra.com/tutorials/723/using-wait-in-loops Thanks for the help, it works perfectly now!