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.

Dark GDK / Help with Walking

Author
Message
Xazrael
13
Years of Service
User Offline
Joined: 27th Aug 2010
Location:
Posted: 28th Aug 2010 01:47
Hi, I am trying to make a 2d RPG similar to the old final fantasy's. I have a simple walking system, but for some reason whenever I press an arrow key, the sprite is delayed in walking in that direction for about a half a second, and sometimes, for example if I am going NORTH, then I press the left key to go WEST, the sprite for walking SOUTH will show up briefly, and eventually will cycle to walking left. What is causing this in my code?
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 28th Aug 2010 06:07
I'm a little tired right now to look over your code completely, so I'll give you a suggestion.

Instead of having just one spritesheet with all the frames for each of the four directions, try using four spritesheets each containing one of the directions.

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Aug 2010 13:07 Edited at: 28th Aug 2010 13:07
When the direction changes, you need to use dbSetSpriteFrame, to set the beginning frame of the new animation. Otherwise the sprite will cycle through all images in between the current state and the beginning point of the new animation. dbPlaySprite in itself is not enough to set the starting point. You may need to restructure the program a bit (or introduce a "previous direction" variable for comparison), to be able to detect the moment when the direction changes.
Xazrael
13
Years of Service
User Offline
Joined: 27th Aug 2010
Location:
Posted: 28th Aug 2010 18:23
Okay thanks. Ill give it a shot

Login to post a reply

Server time is: 2024-07-02 09:19:46
Your offset time is: 2024-07-02 09:19:46