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.

2D All the way! / Help with animation controls and collision

Author
Message
gameangel147
11
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 3rd Aug 2013 11:44
I have a platformer game I am working on and want to add controls to a running animation for the player character so that it can collide with the ground and other objects.





That is what I have so far with some controls for movement. The problems I have is that when I move the animation, it stops while it moves and resumes after. I am also not sure how to add collision with other static sprites. Any help here would be greatly appreciated.
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 6th Aug 2013 00:29
Im pretty sure this is the woring board for this, you would probably get more awnsers in the Dark Basic boards but no matter.

Your problem with the animation is that the "play animation" command sets the animation frame to the first fram on the animation. Then it starts to cycle the frames as you call the sync command. But the way you do it, you reset the frame to the beginning of the animation each frame. What you need to do is to start the animation the first time the user clicks the key and stop it when the user releases the key.

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
gameangel147
11
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 13th Aug 2013 07:24
Thanks for the help, though I still don't know how to add collision, so that it can jump onto platforms and hit obstacles. Also I did post this in the newcomers board but didn't get much help and thought an animation problem falls under a 2D category, but thanks again.
Farhan Arshad
10
Years of Service
User Offline
Joined: 21st Jul 2013
Location: Lahore
Posted: 14th Aug 2013 10:42
This topic explains collision detection in general, you can implement the algorithm in any language of your choice:

http://forum.thegamecreators.com/?m=forum_view&t=206871&b=4

Developer at: http://www.gamingthinktank.com
gameangel147
11
Years of Service
User Offline
Joined: 2nd Dec 2012
Location:
Posted: 27th Sep 2013 04:03
Thanks for link Farhan! This site of yours looks like good resource!

Login to post a reply

Server time is: 2024-02-29 08:40:49
Your offset time is: 2024-02-29 08:40:49