Game Maker's Garage Forum
Game Creation => GameMaker => Topic started by: Zoo on April 05, 2011, 08:19:40 PM
-
How would I make a command happen every second?
-
Set a timer for each second?
-
I thought there was only one timer, so having all of them wouldn't work. But i'll check.
-
Yeah, if a code is like
ON TIMER 100 PRINT 1
ON TIMER 200 PRINT 2
ON TIMER 300 PRINT 3
It just does the last one.
-
you can only have one timer, so you have to use varaibles withiin the timer to emulate multiple timers like this
on timer 1
let timer1+=1
let timer2+=1
let timer3+=1
if timer1=100 then
if timer2=200 then
if timer3=300 then
end timer
-
Eq, something tells me you are in the world of SC. The "lets" and the no spaces between the numbers and the + - =.
-
EQ is writing in SC, but the idea is the same.
ON TIMER 100
mytimer = mytimer + 1
IF mytimer > 3 THEN mytimer = 1
SELECY CASE myTimer
CASE 1
' do this after 1 second
CASE 2
' do this after 2 seconds
CASE 3
' do this after 3 seconds
END SELECT
END TIMER
-
Great. I used this to make a pet-sim.
http://www.mediafire.com/?2p62qtefv764mpm