• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Jump from above?

J

JohnZone

Guest
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