Simon Says - Follow me!

2

Index

Stats

5,953 visits, 12,326 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 1 Jan, 2012. Last updated 19 Feb, 2019

play-Function

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.

  • 0 Comments

Want to leave a comment? Login or Register an account!