Now, we can handle the touch sensors. I added a variable, acceptInput, which is checked before the touch is processed. Right now, acceptInput is simply set to true. You don’t always want to be accepting input during the game, though, so we’ll need a way to ignore player input later.
Here’s how I did it:
Because we’ve assigned each color a number, when you’re building Simon’s sequence and accepting player input, you just need to use the numbers 1 through 4 instead of trying to create an array of colors or light patterns.
I’ll stop here for now so that you can give it a go. Good luck!
