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.

Newcomers DBPro Corner / How do I: one keypress(no holding) smooth movement on a 2d grid

Author
Message
purge
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location:
Posted: 1st Jul 2006 07:54
Hi, i know how to move sprites with dec/inc or by redrawing it grid square by grid square. What i want to know is how you can program it that if i hit a key 1 time and don't hold it down, it will move a sprite from 1 16x16 grid square to an adjacent 16x16 grid square with a smooth sliding animation instead of it jumping from 1 square to the next by redrawing it instantly?

Thanks,
purge
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 1st Jul 2006 10:53
How about something like this, purge?


Assuming that you want to move sprite 1, which uses image number 1.
purge
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location:
Posted: 1st Jul 2006 12:53
Thanks for the reply Dream and Death. You can still see its redrawing the sprite with your code. I am looking for a smooth movement such as in final fantasy 1,2,3, or the free roguelike lost labyrinth(http://laby.toybox.de/?sprache=1). In those games, you can press a movement key once and the character will move from one square to the next with a smooth animation. With or without the animation this is what i want to know how to do.

Thanks for your help,
purge
purge
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location:
Posted: 7th Jul 2006 08:15
Off the first page...*bump*

Login to post a reply

Server time is: 2024-11-26 17:24:58
Your offset time is: 2024-11-26 17:24:58