Mario style: Jump on top of enemy to kill it

Get help using Construct 2

Post » Fri Dec 16, 2011 2:00 am

[QUOTE=Ashley] awesome8x, that's one way of doing it, but the other way saves you having to create and position those 'detector' objects.[/QUOTE]

The benefit though is that the detector method allows you to have the enemy killed only at the point you desire. For instance many times you may be above the enemy but still hitting a part of the enemy that should hurt you (in this case, touching the side of the Goomba's face while you're falling should hurt you and not kill the Goomba).
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sun Mar 18, 2012 8:20 pm

woot this works. Isfalling is great.

lol while messing around I figured out how to make your player bounce when he jumps on a target.

add another action for the player and set the platform vector y to -500 or what ever desired result you want.
B
22
S
5
G
3
Posts: 194
Reputation: 5,855

Post » Thu Apr 05, 2012 1:46 am

@ashley
where do you find the expression
Player.Y < Enemy.Y
and
Player.Y >= Enemy.Y
B
11
S
3
G
3
Posts: 4
Reputation: 2,863

Post » Thu Apr 05, 2012 2:09 am

@Weazl: Those are conditions.
In your example, select the player and select "Compare Y position".Kyatric2012-04-05 02:09:54
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Apr 05, 2012 3:59 am

i would make 3 image points. Or 3 invisible boxes that are attached to the enemy. 2 boxes for the sides and 1 for the head. Once the player jumps on the head destroy enemy and maybe change the y vector in the plaform properties to make the main character jump a little. when the player touches the side of the enemy damage player or lose a life.

I think that would be the easy way of doing it.
B
22
S
5
G
3
Posts: 194
Reputation: 5,855

Post » Fri Apr 20, 2012 8:10 pm



Did it just the way Ashley said so. Even added some little bits to make the player 'bounce' off the enemy.Cpryd0012012-04-20 20:11:39
B
20
S
5
G
5
Posts: 66
Reputation: 4,515

Post » Sun Apr 14, 2013 1:32 pm

Hello,

How to rebound over the enemy's head after destroying it ?? (I.e.: Mario rebounds when it kills a Goomba). Changing the Y vector don't work for me.alexis062013-04-14 14:13:34
B
26
S
4
G
2
Posts: 18
Reputation: 3,056

Post » Sun Apr 14, 2013 2:12 pm

@alexis06 - the post from Cpryd001 directly above yours handles this. It'd also be a good idea to go through the Platforming tutorial if you haven't already.
B
9
S
3
G
4
Posts: 63
Reputation: 3,083

Post » Sun Apr 14, 2013 2:16 pm

Thanks for the link, I just realized my Y vector was 700 and I needed -700 instead ;)
B
26
S
4
G
2
Posts: 18
Reputation: 3,056

Post » Wed Dec 18, 2013 7:55 am

[QUOTE=alspal] [QUOTE=Ashley] awesome8x, that's one way of doing it, but the other way saves you having to create and position those 'detector' objects.[/QUOTE]

The benefit though is that the detector method allows you to have the enemy killed only at the point you desire. For instance many times you may be above the enemy but still hitting a part of the enemy that should hurt you (in this case, touching the side of the Goomba's face while you're falling should hurt you and not kill the Goomba). [/QUOTE]

Agreed, this method makes more sense to avoid allowing the player to kill the enemy when landing on the side of the enemy.

How would this be applied to multiple enemies though?

Awesome8x suggested recreating the events for each enemy, but i'm not sure how I would go about that in a game where the enemies are constantly spawning.
B
12
S
3
G
3
Posts: 35
Reputation: 2,706

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, Yahoo [Bot] and 21 guests