"Simon Says" Style game programming problems
Here is what I have working:
1. My game has 10 buttons. Each button is controlled by touch, or can also be controlled via a game attribute.
2. The game generates and stores a random number from 1-10 each step of the sequence.
3. The game steps through the sequence, and turns on the matching button so the player can see an example.
4. Once the sequence has been played, the game displays a message for a few seconds saying "Now You try!"
All of this works great up to this point. I have made several variants of this, I originally tried to do it with a table and it wasn't reliable, so I re-made it using attributes instead of table cells. The attributes make it more annoying to tweak things like how many steps to a sequence for each level, but it's easier to look at the code and seems to work more reliably.
- After the "Now You Try!" Message has timed out, The user then must touch the buttons in the same order that they were played to complete the level. There is a maximum number of tries for each level, If they make a mistake, they have to start over until they run out of tries, at which point they are either bumped back 1 level or lose the game if they are at the lowest level.
I am having a lot of trouble with implementing step 5. I can get the game to compare the first button you press with the stored attribute for that step of the sequence. The program seems to get stuck here. I have tried putting "display text" in various parts of the code to figure out what's going on, and it seems like the code just stops executing. I have tried all kinds of different things, using rules and the "loop" behavior, and looping through a table or having discrete attributes. I have made so many changes I honestly don't remember everything I have done.
Can anyone point me to a template of something similar or is it possible to explain a simple example of how this should work?