Hello. I'm creating a basic educational game with music, sound effects, visual effects and a automatic timer. I would like the user to manipulate objects on the screen to produce sound/visual effects while a player plays music. I want the stack to advance the use to the next card after a specified period of time, but can't quite figure out how to run a timer while allowing the user to perform actions.
Also, variables are counting correct and incorrect responses. Any advice for a newbie?
Thanks!
Timing in a basic game
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
You will probably need to look at "send" (in <time>) constructions.
For example if you have a sequence of cards that you need to advance after a time limit, as you say, you could make a stack script that has the handlerThen when you need to initiate an event timer (say on cardOpen) you can do something like
That means that when the card with the cardOpen script is opened, it will put a message in the pending messages queue that will activate in 30 seconds. That message will then arrive in the stack script and trigger the advanceCard handler, which will "go next card".
If that's not clear enough, let me know, but HTH.
For example if you have a sequence of cards that you need to advance after a time limit, as you say, you could make a stack script that has the handler
Code: Select all
on advanceCard
go next card
end advanceCard
Code: Select all
on cardOpen
send "advanceCard" to me in 30 seconds
end cardOpen
If that's not clear enough, let me know, but HTH.
Hi Jason,
I wrote quite a bit about timing in the past. My free eBook for Mac and Windows is still available (even though it is a bit dated)
For Windows: http://downloads.runrev.com/revselect/a ... ls_win.zip
For Mac: http://downloads.runrev.com/revselect/a ... ials_x.zip
Hope that helps a bit.
Malte
I wrote quite a bit about timing in the past. My free eBook for Mac and Windows is still available (even though it is a bit dated)
For Windows: http://downloads.runrev.com/revselect/a ... ls_win.zip
For Mac: http://downloads.runrev.com/revselect/a ... ials_x.zip
Hope that helps a bit.
Malte
-
- Posts: 7
- Joined: Fri Mar 13, 2009 6:23 pm
Timing in a basic game
Lovely!
Thanks for the tips. I knew there had to be a easier way than what I was doing (using several "if, then" scripts.
Cheers!
Jason
Thanks for the tips. I knew there had to be a easier way than what I was doing (using several "if, then" scripts.
Cheers!
Jason