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 / Play sprite issue

Author
Message
Tattered brush
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 11th May 2009 10:41
Hi guys

I seem to be having a slight problem with the play sprite command.

I have a 16 frame animation of my character walking left and right, 8 frames for each.

So when the left key is pressed the play sprite command will play frames 1 to 8, when the right key is pressed it plays frames 9 to 16.

The sprite sheet I am using is 2 rows and 8 columns.

However when I run the code the character walks left ok but when you press the right key the character sometimes walks backwards for a second before turning right, is there something I am doing wrong?

I will upload the code tonight if this is not clear.
Tattered brush
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 11th May 2009 16:27
Here is an example of the code I am using:
sprite is a little rough at this stage

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 12th May 2009 02:06 Edited at: 12th May 2009 02:07
while i agree the animation should set its next frame immediately when you change frame ranges, apparently dbpro needs to finish it's current range of frames before moving on. so, you would need to set it manually. see the if statement(s) and new variable currmove (current movement direction) added to your initial code:



yah, i also moved the sprite call to the bottom of the loop to ensure the correct frame was appearing as soon as it was set (that's the theory anyway. ). also, you had an extra endif in there...


Tattered brush
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 12th May 2009 10:40
Thanks for your help, it had me confused for a couple of days. I'm pleased I can move on until I hit my next brick wall lol.

Thanks again!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 12th May 2009 11:42
anytime

by the way, are you making a sam (spade?) detective game? be sure to share!


Tattered brush
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 12th May 2009 13:29
I'm remaking an old Amstrad game by the name of Deathsville. It's a classic adventure where you have to collect items and solve puzzles to progress.

I will definitely share once finished, the sprites are taking more time than anying else to create lol.

Login to post a reply

Server time is: 2024-11-25 06:49:31
Your offset time is: 2024-11-25 06:49:31