Again "Wait" caused some confusion, so here is a tutorial on how to build a "follow me" kind of game.
As allways with my Tutorials, you'll find everything you need in the CAPX
This time a used a 3rd party plug-in. You have to install FUNCTION to get the game to work.
An online demo can be found HERE
Setting up the Game
To be able, to map a random number to a button to light and a sound to be played, we create a little array with the dimension of 4,1,1
This will be filled at "Start of Layout":
The game itself is represented by four sprites acting as play buttons and indicators. The userinteraction is mousebased:
As you can see, every mouseclick will append a global string called userSays with an interger representing the button pressed. And the global user gets increased by one. Both the string and this integer are later used to create to compare-event.
Also the function play"COLOR" is called from within these button events.
There are four play-functions, which only differ in minor points.