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 dbPlaySprite();

Author
Message
ammar26
14
Years of Service
User Offline
Joined: 28th Mar 2010
Location:
Posted: 28th Mar 2010 15:03
I have written a code


i'm having a confusion with dbPlaySprite(); can plz sumone help me i hav some questions

1. Why dbPlaySprite(); has to be in GDK Loop ?
2. dbSync(); needs to be call 2 times then in loop there is only one time ? Why Sprite is running ?
3. In what order the statements will be executed ? i mean that when dbSync(); will be called first time inside the loop of GDK then the dbPlaySprite(); is executed before it then why Sprite Animation doesn't appear One Frame ahead because dbSync(); is called after first execution of dbPlaySprite(); ?

plz help here little confused with the flow of execution of dbSync(); and dbPlaySprite(); here
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Mar 2010 16:19 Edited at: 28th Mar 2010 16:20
you are re-playing the sprite from the beginning everytime the loop is executed so it's always at the beginning frame, you might want to do something like


ammar26
14
Years of Service
User Offline
Joined: 28th Mar 2010
Location:
Posted: 28th Mar 2010 19:19
this is the problem
the Sprite runs fine
i'm asking why the Sprite is not fixed on its first frame bcz i'm playing Sprite again n again in a loop
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 28th Mar 2010 22:40 Edited at: 28th Mar 2010 22:41
Wait, do you want to just use one frame of the sprite?

use "dbSetSpriteFrame(int iSpriteID, int iSpriteFrame)", then just use dbSprite() to show it. You might also want to add the commands "dbCLS()" at the beginning of your "while(LoopGDK())" loop.

http://www.darkgdk.us/ <- You can now submit pages, upload images, yet were lacking content. We need your help!
ammar26
14
Years of Service
User Offline
Joined: 28th Mar 2010
Location:
Posted: 29th Mar 2010 17:36
No i just wanna ask about the sequence of instructions , in which order they will be executed

Login to post a reply

Server time is: 2024-11-20 01:14:00
Your offset time is: 2024-11-20 01:14:00