Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / timers (tier 1) : basic stuff

Author
Message
LittleSteve
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 6th Jun 2012 21:30
Hi guys,

Hopefully this is just me being stupid and the answer is obvious to someone - as all I want to do is something really simple (i think).
If you can recall the old space invaders arcade games where the aliens jumped to the left or right instead of scrolling smoothly.

All I need is the sprite to 'jump' say 20 pixels to the left then wait 2 second then jump again and so on. Ive tried using timers command and then using the setsprite position (as below) to move the sprite to its new posistion but just can't get it to work properly.

SetSpritePosition ( 1, GetSpriteX ( 1 ) + 20 , newy#)

Anyone have any pointers, I just can't understand why the timers doesn't work. or where I'm going wrong.

thanks
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 6th Jun 2012 23:25
How are you using the Timer?

It should look something like this...

LittleSteve
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 6th Jun 2012 23:42
Hi Pilz X Schizo,

thanks for the help, I had the starttime# =timer() within the loop or at least I think I did, I changed it that many times I dont even know where I was (couldn't see the wood for the trees) in hindsight I should have started again and broke it down into simple steps!
You solution nailed it for me.
I really appreciate your help - thanks.

Login to post a reply

Server time is: 2024-05-03 13:48:50
Your offset time is: 2024-05-03 13:48:50