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.

2D All the way! / Move Sprite question...

Author
Message
Chromehawk
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location:
Posted: 13th Jul 2003 18:25
What is the velocity in Move Sprite based on? Is it pixels/sec, pixels/"sync", what? I understand that the velocity tells how far to move the sprite, but the command help doesn't specify the "unit" for that distance.

On a related note, if I say "Move Sprite 1, 5" will that sprite move at the same rate on every machine or will it be dependent on the speed of the computer?

Thanks for the info.

--ChromeHawk
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 13th Jul 2003 21:40
It's pixels I think.
This code decreases the y value of one sprite and moves the other sprite 5. They both move the same ammount.

The sprite will move at the same rate on every computer but bear in mind a faster computer will be able to do more loops every second and so the sprite will be moved more times a second.

To fix this you can either set the sync rate which can be a little unreliable.
You can also link the movement ammount to the ammount of time which has passed since the last loop using the timer().

Login to post a reply

Server time is: 2024-03-02 21:40:21
Your offset time is: 2024-03-02 21:40:21