About jumping animations in platform games

For questions about using Classic.

Post » Thu Jun 10, 2010 1:49 am

Hi, I'm new to Construct, and I'm trying to make a Megaman X clone, starting by following the Platform school and some videos on youtube but I kind of stepped on something very annoying:

Following this video:
http://www.youtube.com/watch?v=y9vs494u4Ik

I managed to get the jumping animation for the character correctly, but for some reason if I try to do it following the Platform school tutorial, Construct will simply load 1 random frame of the jumping animation (it also happens for other animation besides walking and being idle).

Here I upload the file following the video and the other one respectivelly.

http://sites.google.com/site/bgeatelier ... ects=0&d=1
http://sites.google.com/site/bgeatelier ... ects=0&d=1

Also I wanted to ask, in the second file I'm trying to achieve a wall jump, but the character simply jumps upward, witch is logic, but I want to force the jump out of the wall (a diagonal jump) in order to:
1: stop the character from floating all the way up.
2: making the wall climbing more "Megamanesque".

Thanks.
B
2
G
2
Posts: 32
Reputation: 714

Post » Thu Jun 10, 2010 12:05 pm

Well, your events for the standing animation is overriding the jump animation.
What you have now is:

-Player is walking
+ set animation run
else
+set animation standing

Your 'else' condition is true whenever the character isn't walking, and it is messing with your jumping animation.

I'd instead suggest doing this:

-Player is on ground
-Player is walking
+set animation run

-Player is on ground
-Not! Player is walking
+set animation standing.

That way your standing and run animations will play 'only' when the player is grounded.

Also, when you have jumping animations with multiple frames you'll want to loop back to the last one. So set the jumping animations "repeat to" property to 4.

Here's a cap where I've made those changes: http://www.box.net/shared/5zhvukho7k
I also deleted your left facing animations and instead applied the auto mirror property.

I don't really know what's causing your inWawll animation to not play properly though.

However, what you want to do with the wallclimbing to prevent the player floating upwards is force the player away from the wall when the player presses jump.

Right now you are merely having the character jump when the jump key is down, and the player will move upwards only, and that means the "P. has wall to left/right" will stay true, since the player isn't moving away. Furthermore, you've used "Player 1 'jump' is down".

If you instead use "on control pressed" for the wall jump and make it so that the jump not only moves up but also away from the wall, you'll get rid of the floating and it will be more like the megaman walljump.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Thu Jun 10, 2010 5:44 pm

Hi Inkbot, thanks for the fast reply, it helped me a lot!

Now I get why the jumping animation didn't work, and it also helped me solve the "inwall" animation too, the "falling" animation overlapped the "inWall", so I solved it adding a private variable that conditioned witch one to play.

I didn't know what "on control pressed" mean, but testing it showed that you were totally right! Adding to that the set "horizontal speed" action made the game feel really Megamanesque!

If anywone else is interested in the final result here it is, check out the file:
http://sites.google.com/site/bgeatelier ... ects=0&d=1
B
2
G
2
Posts: 32
Reputation: 714


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests