Advertisement

Bomberman FPS/Movement speed

Started by November 25, 2002 05:43 PM
11 comments, last by WoolyUK 22 years, 3 months ago
Move per unit of time, rather than per frame.
quote:
Original post by Anonymous Poster
Move per unit of time, rather than per frame.



Thats what i said!!!!!!!! Its called realtime programming.
Advertisement
Well you figure out the time it took for the last frame to render, in seconds. Typically you'd get very small values, something like 0.015 or something. Then for every time you need time-based movement, instead of

player.xpos += 0.1;

you'd use

player.xpos += 0.1 * time;

In this example, this would move the player's x position by 0.1 units per second, interpolating the movement on each frame automatically.

_________
"Maybe this world is another planet''s hell." -- Aldous Huxley

[edited by - Lord FlatHead on November 29, 2002 3:53:08 PM]
_________"Maybe this world is another planet''s hell." -- Aldous Huxley

This topic is closed to new replies.

Advertisement