How do I make a "hit animation"

Get help using Construct 2

Post » Sun Aug 17, 2014 9:04 pm

Well i have created the following little platformer.
https://www.dropbox.com/s/wdc2fgr8regngd9/SimonJumping.capx
Find the key. then find the lock to open the door.

All i want (at the moment) is:
If the Player falls into lava
-change UI_life->Frame
-make player jump up a little bit (maybe even flash him) (to notice he got hit(damage))
-fall again.

I hope it is clear what i mean.
It's like Sonic the Hedgehog getting hit und getting knocked back... but i want the player to kinda jump.
B
6
S
1
Posts: 30
Reputation: 1,059

Post » Sun Aug 17, 2014 10:30 pm

Well, I have only ~a week on Construct, I don't know what do you refer with "-change UI_life->Frame", but:
Player -> On collision with another Object -> Lava:
- to make player jump a little: Player -> Set vector Y -> -300 (you can try a smaller or a bigger value, but it need to be negative)
- to make player flash: add behavior "Flash" to player and then, Player -> Flash -> (select the duration, depends on how you like it)
- fall again: he'll fall automatically, no need to change the vector again

Hope I could help :D

Edit:
Oh, and add a System -> Wait -> (seconds), after the above events and before the System -> Restart Layout.
B
9
S
1
Posts: 33
Reputation: 596

Post » Sun Aug 17, 2014 10:54 pm

Perfect answer from cornelg7
And here the capx after adding the events
You do not have the required permissions to view the files attached to this post.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Mon Aug 18, 2014 9:27 am

ok that worked so far....
but after jumping and falling he lands into lava ;) but i want the player to fall out of screen... (through the solid rocks under the lava)
B
6
S
1
Posts: 30
Reputation: 1,059

Post » Mon Aug 18, 2014 9:35 am

add an action to disable collisions on the rock..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Aug 18, 2014 11:07 am

Oh yeah simple idea :D

but then all my enemies fall down as well ;) but i dont want that.....
B
6
S
1
Posts: 30
Reputation: 1,059

Post » Mon Aug 18, 2014 11:32 am

A0Nasser already put a new action there, Player -> Set collision enabled -> Disable, that is disabling any collision with the player and he fall through anything...
B
9
S
1
Posts: 33
Reputation: 596


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 32 guests