How to I kill enemies by jumping on them?

Get help using Construct 2

Post » Mon Apr 15, 2013 5:37 am

So I've been trying to follow the tutorials where you make enemy sprite, create an event where

if player collides with enemy
then either check if platform is falling (if so kill) else player take damage.

This does not work for me! I don't understand why. I have the platform behaviour attached to my player box. The hitboxes are fine. But the "is falling" condition never activates.
I also tried another tutorial where I had to setup an animation that would fire when falling, that didn't work either. Where am I going wrong with platform behaviour?



Also, can someone explain to me how setting the platform's X or Y vector works? I set the vector X to -2000000 if I run into the enemy, but it knocks me back only a tiny bit. Even if the number is -60000000 or -500 it doesn't make a differenc.eAnthonyB282013-04-15 05:43:35
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Apr 15, 2013 8:12 am

Not sure where the issue is as it seems to work fine for me, here is the events that I have from that same tutorial that work just fine:



You may want to post the CAPX so we can take a look, there may be a behavior or event issue that we cannot see outside of the events you are showing us.

For your other question, Vector X/Y moves the sprite in the appropriate direction by that many pixels... Assigning a negative value to Y moves you upward. Assigning values to X moves you either left or right. So you need to capture the direction the player is moving when using the X vector as you need to know which way is "back" when you want to bounce them. My double jump and wall jump tutorials have a bit of tweaking with this as well. You can find them in my signature.BluePhaze2013-04-15 08:16:16
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Mon Apr 15, 2013 4:56 pm

[QUOTE=AnthonyB28]
Also, can someone explain to me how setting the platform's X or Y vector works? I set the vector X to -2000000 if I run into the enemy, but it knocks me back only a tiny bit. Even if the number is -60000000 or -500 it doesn't make a differenc.e[/QUOTE]

You'd have to change the player max speed as well. It won't make a difference if you set vectorX to 500 or 60000000 if the player max speed is 330.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Tue Apr 16, 2013 3:14 am

https://www.dropbox.com/AnthonyB282013-05-14 18:15:04
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Apr 22, 2013 5:32 pm

bump
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Apr 22, 2013 6:32 pm

This was covered in the C2 class this past weekend, you might want to watch the video here where Yann shows how to stomp enemies:

http://www.scirra.com/forum/construct2-live-class_topic65550_post409490.html#409490Xavier2013-04-22 18:33:22
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Sun Oct 05, 2014 2:00 pm

Hi guys..I have the same problem like ramones...why vector X is working just a few pixels only...I know there are other ways to move a collided player far from the enemy...but i would like to use vectors...any suggestion ???

thanks :)
B
28
S
10
G
2
Posts: 402
Reputation: 3,915

Post » Fri Oct 10, 2014 4:59 pm

@anthonyb28 an easy solution may be to just have a sprite pinned to the feet of your character and when that collides with the enemy it will destroy the enemy.
B
13
S
5
G
1
Posts: 119
Reputation: 2,292


Return to How do I....?

Who is online

Users browsing this forum: Mohicano and 31 guests