Jump on Enemy

For questions about using Classic.

Post » Fri Sep 05, 2008 9:47 pm

Hello! This seems easy enough, yet I haven't been able to pull it off.

What I'm trying to do is have the player be able to jump on the enemy and destroy them, like Mario, then bounce off.

For this scenario we'll assume the player's floor detector has the platform movement, not the player's sprite.

My initial thought was this event:

Player Floor Detector Y greater than Enemy Y
+
Player Floor Detector collides with Enemy
+
Player Animation "Jump" is playing
=
Destroy Enemy, Player Floor Detector= Jump


Now, the problem is that it doesn't work for me. I tried compare height but I guess that means sprite height, not actual position height. Also, all my enemies are under the family "enemy" and I cannot compare the detector's Y to the family enemy's Y (I suppose that is too ambiguous, so doing the event for each enemy wouldn't be so bad)

Any ideas? Me feels so stoopids...
B
13
S
3
G
5
Posts: 286
Reputation: 3,193

Post » Fri Sep 05, 2008 10:03 pm

I think it's because of this:

"Player Floor Detector Y greater than Enemy Y"

That should be if the detector's Y position is LESS than the enemy's Y position. :P Less is higher, greater is lower. Unless that's not how your code is setup.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Fri Sep 05, 2008 10:56 pm

AHHHH BEAVER! :mrgreen:

LOL right on linkman!

2 MiNUTES LATER UPDATE:
YES! It works great! Thanks duder!
B
13
S
3
G
5
Posts: 286
Reputation: 3,193

Post » Fri Sep 05, 2008 11:21 pm

No prob'. Glad I could help. :)
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests