Friday, September 5, 2014

The Mystery of the Turn Animations for 8 Way Movement (Construct 2)


Oh how it boggles the mind.  My mind is all a boggle.  I started off really proud of myself because I fixed a problem I was having in Construct 2.  Turns out the stopping animations from yesterday's post work great unless you start moving again mid-animation.  The game really didn't like that.  So I spent a half hour over thinking the whole thing and making a mess of my code.  Stepped back for a moment and the solution was right in front of me.  Just change the Animation State back to "Start" and trigger the animation again.  Pretty Easy.

In the middle of my "over thinking" phase, I contemplated triggering a turn animation to break up the stopping and starting.  That got me thinking about how I really haven't solved that problem yet.  I think I can get away without a turn in the slower flight animations, but the fast flight animations will be more obvious with the body flattened out and constantly turning.

Its probably going to need to be done with a bunch of conditions and some way of overriding the existing movement based angle animation.  That, and will I have to account for the time it takes to press the buttons.  If you are holding the left arrow and then press the right arrow to change direction, wouldn't there be a moment inbetween where neither keys are down.  Hmmmmmm.

Looks like I need to go to the forum.  More soon.

EDIT: Putting this here so I don't forget.

Shanon White (CaptainZeroGame on Twitter) suggested I make a variable for the last direction my player was going.  Then I will just compare that with my current direction.  If its East and West, play animation.  I'll have to trigger it in the spots where the movement angle is changing my abbreviation for the movement.  This probably doesn't make sense, so I'll put a bit of code up if I get it working.
-Ben

No comments:

Post a Comment