Bomberman FPS/Movement speed
quote:
Original post by Anonymous Poster
Move per unit of time, rather than per frame.
Thats what i said!!!!!!!! Its called realtime programming.
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]
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement