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 / How To Synchronize the Archer in Shooting an Arrow

Author
Message
elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 5th Dec 2009 13:20
I was wondering since i started to use dark GDK i could not synchronize my sprited archer with its arrow. The archer just played its sprites while the arrow keeps going from left to right. Could anyone help me wherein when the archer will set the string of his bow free the arrow will then fly out from his bow? I will really appreciate it.

Here is my code:


Thanks in advance!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 5th Dec 2009 17:02
first, sprite 1 wont play because you have playsprite() inside the loop, you can either put a dbLoopSprite() outside the loop, or :


you want it like : you have a sprite which is the archer ( animated ) and an arrow sprite, and you want the archer to use the arrow once his sprite reaches a specific animation?



elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 6th Dec 2009 04:32
Thanks for the reply but i think the dbPlaySprite(1) does not take only 1 argument that's what it says when i build it. And the dbSpritePlaying are undeclared identifier.

But I get your idea. Sorry my post was lacking of info what I meant was that when the bow flies out the archer will not yet play its animation until the arrow reaches the edge of the screen. If it has then it will play again.

Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 6th Dec 2009 08:39
Get the position of the arrow, if its bigger than the screen resolution than replay animation.:

psuedo code or somthing like that


Hope this helped you.

Isocadia
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 6th Dec 2009 13:06
yes it doesnt take one argument lol, by writing the code i didnt mean to give you code to copy paste, i was giving the idea xD

elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 6th Dec 2009 14:58
Hey guys, I have made my archer synchronize with the bow and stop it from animating the archer to fire again unless it hits something.

Thank you all for you help really appreciate it.
elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 6th Dec 2009 15:14
@Hassan

Oops sorry my bad...i was having a lot of thoughts and make me confuse but i got your idea. It really help a lot.

thanks

Login to post a reply

Server time is: 2024-10-01 18:22:10
Your offset time is: 2024-10-01 18:22:10