The game is a fixed grid, with buttons that use matchstick icons that the player clicks and drags to make a specific shape. I need to implement a timer which counts down from 60, and upon reaching zero will end the game.
What I have for that so far is a card that open on a screen-sized button saying "click to start":
Code: Select all
global sFlag
global lives
on mouseUp
show field "displayTimer"
put 60 into field "displayTimer"
put true into sFlag
send "updateTimer" to card "puzzle #1"
put 3 into lives
Code: Select all
global sFlag
on updateTimer
subtract 1 from field "displayTimer"
if field "displayTimer" = 0 then
put false into sFlag
answer "Game Over"
end if
if sFlag is true then
send "updateTimer" to me in 1 second
end if
end updateTimer
Code: Select all
if V8 and V10 and H5 and H10 and H12 then
put false into sFlag
end if
As well as this, I need to remember a player's name. On my "introduction" screen, I have a little avatar who pretends to be Professor Oak and asks for your name. I have a simple "ask "What is your name?"", but I need to have a text field that uses that name. Like "So, Noytal is it?". How could I do this?
And last request, if the player submits a wrong answer three times, they lose. I have a field for displaying lives, a variable "lives" and the opening button puts 3 into lives. When the user presses Submit and is wrong, I need to change it to put 2 into lives, then 1 into lives, then go to a game over card. How do I do this?
Thanks, sorry if my request is vague, and I can provide more details if you need.