Topic:   command time!   (Read 19479 times)


0 Members and 2 Guests are viewing this topic.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
command time!
« on: April 05, 2011, 08:19:40 PM »
How would I make a command happen every second?
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: command time!
« Reply #1 on: April 05, 2011, 09:33:19 PM »
Set a timer for each second?

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: command time!
« Reply #2 on: April 06, 2011, 03:33:07 PM »
I thought there was only one timer, so having all of them wouldn't work. But i'll check.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: command time!
« Reply #3 on: April 06, 2011, 03:35:49 PM »
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.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: command time!
« Reply #4 on: April 06, 2011, 06:35:11 PM »
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

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: command time!
« Reply #5 on: April 07, 2011, 03:13:53 PM »
Eq, something tells me you are in the world of SC. The "lets" and the no spaces between the numbers and the + - =.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: command time!
« Reply #6 on: April 07, 2011, 08:45:37 PM »
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


Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: command time!
« Reply #7 on: April 08, 2011, 02:18:41 PM »
Great. I used this to make a pet-sim.
http://www.mediafire.com/?2p62qtefv764mpm
Kirby, your pudgy buddy from dream land, is back again on the game boy®!