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 / need help with dbPlaySprite

Author
Message
chikarazuyoi
15
Years of Service
User Offline
Joined: 12th Sep 2009
Location:
Posted: 13th Sep 2009 20:08
I have all my images for one character on a giant sprite sheet, but whenever i use the dbPlaySprite () function the animated sprite goes outside of the "int iStart" and "int iEnd" and my character performs actions which are not what i expect, anyone know what's is going on?

For example, when i want to walk, my character with pull out his bow, but once the sprite loops back to the "int iStart" and "int iEnd" it stays there.

Thanks anyone who offers advice
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 14th Sep 2009 21:33
When the animation changes, before calling dbPlaySprite, use the dbSetSpriteFrame function to set the first frame of the new animation.
chikarazuyoi
15
Years of Service
User Offline
Joined: 12th Sep 2009
Location:
Posted: 15th Sep 2009 01:47
well i tried dbSetSpriteFrame, i did this by using the function to get the frame I'm on, and if I'm on the wrong frame I call dbSetSpriteFrame, but my compiler complains about the function that gets the frame number is a bool, i cant remember the function to get frame number but maybe I'll edit later, the error is skipped but I think it's is preventing me from using dbSetSpriteFrame appropriately, any suggestion for this?
logicandchaos
15
Years of Service
User Offline
Joined: 22nd Sep 2009
Location:
Posted: 1st Oct 2009 21:28
I had the same problem with playing sprites, i used the dbSetSpriteFrame() before calling dbPlaySprite() & it resulted in my sprite not animating, so i tried
if(dbSpriteFrame(1)<11)
dbSetSpriteFrame(1,11);
if the sprite frame is less than the starting animation frame then set it to the starting animation frame
& that works great for me

"there are 10 types of ppl, those that understand binary and those that don't"

logicandchaos

Login to post a reply

Server time is: 2024-10-01 12:23:07
Your offset time is: 2024-10-01 12:23:07