They are pretty straight forward and illuminates the button as well as plays the coresponding sound.
Since we have to have the buttons be played by the machine as well, I decided to make this code reusable by useing the function plugin.
Now, that we know how the user interacts and how the buttons work, let the fun begin.
Start the game
The game starts by the machine playing the first note. This is done by calling the function simonsLastWord from within the "Start of Layout" event, after the array has been filled up.
So, what exactly is done here? First we raise the simon counter, which is actually nothing else but the length of the string simonSays.
simonSays itself gets appended with a random value between 0 and 3.
So each time this function is called, the string simonSays grows, looking somewhat like this "010023..."
At the end of the function, the flag for the repeat event is set.