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 / Moving an Animated sprite to mouse x,y

Author
Message
tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 19th Mar 2010 02:13
Hi i'm trying to get an Animated Sprite to walk to the X,Y postion of where the mouse is clicked on screen, i can get it to work with the Arrow keys but not the mouse.




FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 19th Mar 2010 04:47
Hi tonycrew,

Please check the code I posted here: http://forum.thegamecreators.com/?m=forum_view&t=165207&b=1

Best regards

JF
tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 19th Mar 2010 13:33
Hi thanks for the reply, i got it sort of working, but the 4 frames of animation don't play, and when the sprite gets to the x,y pos then it judders..?



FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Mar 2010 15:27
This should take care of the 'judders'.



To play the animations you need to use the PLAY SPRITE command. I placed in the code what I think you are looking for, but I cannot test it.

tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 19th Mar 2010 16:18
Thankyou both it works great now

i just added a play sprite 1,1,4,100 under sprite 1,X,Y,1 to get full frames of animation. I am getting to understand sprite and mouse control now.

FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 19th Mar 2010 17:05
And what about when clicking buttons to move left or right, so far this code works but the sprite kind of glides instantly to the left or right




FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Mar 2010 18:01
You have enclosed the sync inside your if / endif(s); you should get the sync out of that.

Login to post a reply

Server time is: 2024-09-28 16:30:11
Your offset time is: 2024-09-28 16:30:11