• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Legacy GM Jump from above?

JohnZone

Member
How do I program it like that -> if the player jumps from above onto an object -> it deletes itself (the object)?
And how can I program it like that: if the player jumps from left or right, the player himself deletes himself?

(I know and already have the jump code, I just need the other thingies)
 

TailBit

Member
In the collision event you can use the keyword other to refer to the other instance in the collision.

Then you could just compare their y coordinate
Code:
if(y+5 < other.y){ // if player is still above enemy after being moved 5 down
    instance_destroy(other);
}else{
    instance_destroy();
}
 
Top