Jump to content
  • Advertisement
Sign in to follow this  
prof_89

Making an character move (walk)

This topic is 4281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi again, we have gotten a bit further in our game now. As you might see if you test the game you see that if you move, you just "poff" and you are at your next position, we would like to make the character actually GO to the next tile instead of just teleport himself there... how could we do that ? http://www.freewebs.com/prof_89/appletgame/spel.html

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
due to the discrete nature of computer logic, the display of all motions consits of a series of static scenes
it is the human mind who interprets two different scenes as motion

sometimes though, unimaginitve minds choose not to 'see' that the object on screen has moved; and sees 'teleportation' instead.

we can help people like that, by using smaller steps (with less change) from one scene to the next.
in other words, increase your framerate.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
ok, looking at your game (same AP as above btw)
I'm guessing that you're game is Tile Based
and to whenever the user presses a control, you simply redraw the character's sprite on top of a different tile

personally, i dont think its that much a problem, considering this is an browser applet, and there is a great precedent for this kind of motion to pass as 'motion' to most gamers of the browser applet genre

but if you really want it to look smoother, you're going to have to rework your rendering methods to allow for sprites that do not align with the Tiles.
Then when the player moves, rather than simply redraw him on the next tile, draw him 1/4 of the way between them, then 1/2 way, then 3/4s the distance, finally ending with a final redraw in the new position. Of course, more inbetween positions will look smoother. But you get the key concept.

Share this post


Link to post
Share on other sites
What I implemented in my latest project (and what is done in most similar games from what I know) is some (most popular A*) path finding algorithm.

Once the path to the destination is found I made my sprite move by 4 pixels every fame (that lasts around 0.1 sec) from one square to another (according to the path found) till it reaches its goal.

Also, my sprite image changes every frame (legs and arms are moving) for even better movement animation look.

This takes quite a bit time to organize and implement things but the final effects look good.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!