Page 3 of 3

Re: Sonic style physics and collision code?

PostPosted: Thu Dec 15, 2011 9:48 pm
by CrimsonTheDarkBat
Alrighty, I found the culprit - the animations of the player actor. Just tested him running up the slope as a static, spherical ball and there were no bumps.

Now what do I do? :C

Re: Sonic style physics and collision code?

PostPosted: Thu Dec 15, 2011 9:56 pm
by skydereign
Ah, yeah that happens a lot (to the point that I always use two actors at least for the player). One is a collision actor, and the other handles the animations. I forgot that you'd be using an animated actor for your collisions. So, what you should do is separate the animation part of the actor from the movement/collisions. The collision side can have its visibility state set to enable events (but not draw), and the animations should use xy position to follow the movement actor (instead of parenting [unless you use a framed region as the movement]).

Re: Sonic style physics and collision code?

PostPosted: Thu Dec 15, 2011 10:25 pm
by CrimsonTheDarkBat
Great job man, that plan worked perfectly and things are all ace! :D

Thanks so much for your help! :D + Rep :)

Only thing that needs fixing now is Moonwalking - what's the best way to tackle that? xD

Re: Sonic style physics and collision code?

PostPosted: Thu Dec 15, 2011 10:29 pm
by skydereign
I personally would suggest the state method. I think it is the most standardized and dynamic way of fixing moonwalking. Also it's a good way to solidify variable control to your skill set, if it isn't one already. Here's a little lengthy description of it that I wrote for a new user. http://game-editor.com/State_Method

The main idea behind it is you use a variable to hold what the actor is doing (such as running, standing, jumping) and in any event that would change its state, you use a switch statement. That way, you can say if the actor is running when you press attack, you can make it do something different than if it were standing.

Re: Sonic style physics and collision code?

PostPosted: Thu Dec 15, 2011 11:26 pm
by CrimsonTheDarkBat
Sweet, got it fixed in one shot with your guide. :D

Thanks a million, dude!