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