How do I bounce on enemy's head?

Just started using Construct 2? Post your questions here

Post » Wed Mar 25, 2015 5:52 pm

I'm sorry for this thread, I know this has been asked dozens of times already but even if I found several threads asking it, I couldn't find a solution for my issue.
Also, please forgive me if this is something easy, I'm a total noob with construct. Please be patient with me.

I'm trying to make a local multiplayer game in which jumping on the enemy's head makes your character bounce, without killing the enemy.
I thought it was easy, I followed the "how to make a platformer" tutorial and used the same behavior it used to jump on the enemy and kill it, minus the killing part. I also removed the part that said "if the player touches the enemy at other angles he gets damaged", since I don't want that to happen. I just want to continuously bounce on the enemy's head when I jump on it.

The point is that it doesn't work. The character just stays on top of the enemy's head.
Here's my .capx, in case you have the time and the patience to help me (please).

(https):// www (dot) dropbox (dot) com/s/98lfgvjyo5nrqud/ayy%20lmao.capx?dl=0

Notes:
-The grey alien moves with the directional arrows
-The pink alien moves by connecting an xbox 360/xbox one controller and pressing "A" to jump and the D-pad to move
-Being this a local multiplayer game I tried to make this behavior happen exactly the same way for both players
-I tried using "on collision > compare y to player2's y" instead of "platform is falling" and while it seems to work better, at first, it gets randomly activated by simply touching the enemy, without actually jumping on him.
-I also tried adding an invisible sprite to player 1's feet but the detection seems very imprecise, sometimes it works and sometimes the player just stops on the enemy's head


Sorry again for causing trouble (and probably messing things up haha...) and thank you in advance for your help.
B
8
S
1
Posts: 20
Reputation: 490

Post » Wed Mar 25, 2015 7:51 pm

Image
B
62
S
23
G
7
Posts: 1,469
Reputation: 10,729

Post » Wed Mar 25, 2015 8:43 pm

Message: WadaKatsu is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
korbaach wrote:............

Amazing thank you! That's not how the platformer tutorial nor the live twich lessons explained it... do you mind telling me what you exactly did? I mean, I've seen it but being the noob that I am I truly can't understand how you could fix it.
For what I understood, the "is overlapping" command only works if the sprites aren't solid, how could they actually overlap each other when they are solid?

Also, while this solution is incredibly close to be working, it's still possible to make one of the two aliens stop on top of the other's head. If you keep mashing the jump button while an alien is bouncing on your head, after a few tries you can stop him.
B
8
S
1
Posts: 20
Reputation: 490

Post » Thu Mar 26, 2015 4:03 am

Image
B
62
S
23
G
7
Posts: 1,469
Reputation: 10,729

Post » Thu Mar 26, 2015 10:26 am

Message: WadaKatsu is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
korbaach wrote:Image


Thank you so much, a picture is worth a thousand words!

Thank you again, this is perfect.
B
8
S
1
Posts: 20
Reputation: 490

Post » Sun Mar 29, 2015 9:57 pm

In the 7th part of Ashley's "How to make a Platform game" tutorial, he demonstrates a great way of doing this:

https://www.scirra.com/tutorials/253/ho ... ame/page-7
B
51
S
9
G
1
Posts: 9
Reputation: 3,689

Post » Mon Mar 30, 2015 3:53 am

Message: WadaKatsu is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
patmaru wrote:In the 7th part of Ashley's "How to make a Platform game" tutorial, he demonstrates a great way of doing this:


As you can read in my previous posts, that's what I did at first. It seems that the method described in that tutorial isn't very reliable when you just need the bounce effect, without actually killing the enemy (or, at least, it isn't in low-res pixelated games like mine).
B
8
S
1
Posts: 20
Reputation: 490

Post » Mon Mar 30, 2015 6:52 am

Oops! Read it too early in the morning. My apologies.
B
51
S
9
G
1
Posts: 9
Reputation: 3,689

Post » Sun Oct 18, 2015 4:49 pm

Hi.
The linked files don't exist anymore and I'm trying to achieve this effect. I want the player bounce off the enemi when jumping or falling on its head, but not if it touches the enemy from the side.

I tried something like :
Player -> is overlapping enemy at offset (0, 1)
Player -> is NOT overlapping enemy at offset (0, -5)

But it doesn't work as expected. It limits the player from bouncing on an enemy when coming from the side but it doesn't totally prevent it, and if the player if falling at high speed, it passes the Y -5 offset and doesn't bounce on the top of the enemy.

Any idea ?
B
12
S
7
G
7
Posts: 448
Reputation: 4,272


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests