Character Movement (Do it right)

Get help using Construct 2

Post » Sun Sep 09, 2012 4:01 pm

Hi there,

I have tested out a lot of different solutions for my Character-Movements. But i could't find the right way. The Basics are simple - but when i have more animations that my character can do, so i can't find a good working way.

Have anyone of you a little *.capx for me?

That will be great!

Thanks!

KMagKMag2012-09-09 16:01:46
B
13
S
4
G
3
Posts: 120
Reputation: 3,456

Post » Mon Sep 10, 2012 9:46 pm

You don't say what kind of game you are making, so I don't know if this will help, but here is a simple example I made to change the animations of butterfly sprite that has an 8-direction behavior.

When the butterfly sprite isn't moving its animation is set to an animation called idle. When the sprite is moving the animation played depends on how fast the butterfly is moving. If moving relatively slow the animation played is one called fly. If going relatively fast the animation played is one called flyfast.

You can do something similar with platform behaviors, too. You can change the animation when the player jumps, is falling, is going left or right, etc. Examine the events for a behavior to see the places where it may be appropriate to change the animation. Of course you can always change an animation based on your own custom criteria.

ButterflyFly.capx

kittiewan2012-09-10 21:47:18
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Fri Oct 17, 2014 12:41 am

You could also set the Animation speed to a factor of the Movement speed ..
This way the animation speed is in sync with the movement

Eg:
every tick ...set animation speed to current movement speed +/- (any value you like) or divide the movement speed by a percentage...

makes very smooth looking animations
of course you may want to limit or cap the animation speed to a certain value
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 294
Reputation: 7,297


Return to How do I....?

Who is online

Users browsing this forum: badmoodtaylor and 14 guests