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.

Newcomers DBPro Corner / timer command

Author
Message
GameMaker Jason
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 28th Jan 2004 22:50
how do i get the timer to store the time in a integer becuase i want it use in my space invaders so that the enemy move every 8th of a second but using the wait command slowed the whole program down.
can you give me the code please?

just code
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 28th Jan 2004 23:16
Timer() is a return only function it cannot be set.

However there is a trick you can use for updating things at regular intervals:


Hope this helps

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Reaperman
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: Kent, England
Posted: 28th Jan 2004 23:26 Edited at: 28th Jan 2004 23:28
Jason.

You don’t need to use the wait command or even the timer, for your space invaders.

You can slow/speed them up/down in a number of ways:

1. You can flag them with a variable that you use to determine how far they can travel.

2. You can use a variable to set the speed of the animation to tie in with the movement.

As for the timer, you have to remember that 1000 units represent 1 second, so 500 units is .5 (half a second) etc. So you should be able to work out an 8th of a second.

Or you can use the snip that EC has given you..... So you have a few things you can try.

Hope that helps you a bit.

Login to post a reply

Server time is: 2024-11-26 01:33:05
Your offset time is: 2024-11-26 01:33:05