48
« on: October 17, 2015, 04:14:21 pm »
1.
When created:
list_1= create new list // list_1 stores the sequence that player must reat
add random number (0,5) to list_1 //I assume you have 6 buttons
create 6 button actors, set for them actor attribute color to 0..5, store buttons in list actor_list
do after (some time)
trigger beep // event is responsible for beeping buttons to player then gives player time to repeat
2.
Event beep
a=0
while a< number of items in list_1 // for each element in sequence
find button actor that color = list_1(a) in actor_list
change animation of that button + sound proper sound
wait(some time) // we want to give some time between beeps
a++
//beeping over, player turn starts
input_list=new_list // this list stores sequence of buttons pressed by player
button actor behavior:
when mouse pressed on self
add color to input_list
if not(input_list(number of items in input_list -1) == list_1(number of items in input_list -1))
// player messed up sequence
play (you messed up) sound
wait (some time) // give player time to accept this harsh truth
trigger beep
else
if number of items in list_1 == number of items in input_list
// player pressed successfully last button in sequence
add random number (0,5) to list_1 // increase sequence
trigger beep
----------------------------------
More or less; may contain upgrade so as make it impossible to press button while beep is triggering;