How do I set "On jump" state when stomping Enemies?

Get help using Construct 2

Post » Wed Apr 02, 2014 5:30 pm

Supose that we are in a Super Mario style game. We are managing the Player (with Platform default controls enabled) and jump to stomp an Enemy.

1) When the jump starts, Player is "On jump".
2) Then he starts falling down and his state is "On fall".
3) But then, he stomps the enemy and we "set Player vector Y to -n".
4) Player is pushed up but his state hasn't changed, is going up while he thinks is still "On fall"
5) When he reaches the max high and becomes falling again, he also doesn't know that hes falling for the second time cause he thinks that has been falling all the time.

There is an option to solve this or a way to force a Platform object to know that it's "On jump" or other state?
Image
B
13
S
1
Posts: 74
Reputation: 886

Post » Wed Apr 02, 2014 5:56 pm

If you're using the platform behavior, all of that functionality is built-in:
https://www.scirra.com/manual/100/platform
B
77
S
43
G
24
Posts: 525
Reputation: 20,580

Post » Wed Apr 02, 2014 6:13 pm

You can use a boolean ("isJumping" for example) and put it true when jump and when he stomps the enemy.

EDIT: Something like this:
You do not have the required permissions to view the files attached to this post.
B
21
S
8
G
7
Posts: 49
Reputation: 5,274

Post » Wed Apr 02, 2014 6:37 pm

Can't find a solution in the documentation :(.

I can use the boolean, and activate it when he stomps the Enemy, but cannot activate a different boolean to check when he's falling again, cause is not possible to recognize when that event occurs since he already think is falling.
Image
B
13
S
1
Posts: 74
Reputation: 886

Post » Wed Apr 02, 2014 7:19 pm

on fall play falling animation
on jump play jumping animation
if platform is falling
trigger once--------------------------play falling animation
if platform is jumping
trigger once------------------------play jumping animation
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Wed Apr 02, 2014 7:31 pm

@Roccinio
Hey! This is better than my example :oops: , thanks! Hahaha!
B
21
S
8
G
7
Posts: 49
Reputation: 5,274

Post » Wed Apr 02, 2014 7:36 pm

@Seasky
simplicity is bliss in programming! :p
to be honest i had spend quite some time trying to figure this easy little thing by my own so please share the knowledge!
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Thu Apr 03, 2014 8:22 am

Roccinio, could you explain that again?. Cant understand it. Maybe im too novice...

Remember that the main trouble is not with the animations themselves, i need to know if hes going up or down for different behaviors in game.
Image
B
13
S
1
Posts: 74
Reputation: 886

Post » Thu Apr 03, 2014 10:56 am

Ok. Understood :P
Image
B
13
S
1
Posts: 74
Reputation: 886


Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk and 60 guests