Sign in to follow this  
Hekmawful

Smooth player movements?

Recommended Posts

Hekmawful    104
Hello.

I'm basically creating a game made if tiles/blocks.
The player moves like 1 tile, but that just looks bad.
Is there anyway to make it look like he walks to the tile position, like make an animation to the position?

Share this post


Link to post
Share on other sites
Exessuz    141
yes you can animate a sprite and interpolate each frame as an animation, and move using delta time.

this link is for c++ but you can get the idea http://www.programmersheaven.com/2/time-fps

ej

currentpos += dir*deltatime;

Share this post


Link to post
Share on other sites
zdd    107
[quote name='Exessuz' timestamp='1346187461' post='4974235']
yes you can animate a sprite and interpolate each frame as an animation, and move using delta time.

this link is for c++ but you can get the idea [url="http://www.programmersheaven.com/2/time-fps"]http://www.programme....com/2/time-fps[/url]

ej

currentpos += dir*deltatime;
[/quote]
This is a good idea, time delta is widely used in geometry transforms like rotation and translation.

Share this post


Link to post
Share on other sites
StrangeTurtle    133
Check out this basic physics flash movie. http://www.rodedev.com/tutorials/gamephysics/

you need to keep adding acceleration over time to the velocity of the object changing its position until it reaches the final target location.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this