SOLVED A goomba like enemy

I am trying to create a goomba like enemy for my personal project but i don't know how to make so that the enemy can be stomped if you jump on it and kill you if he touches you from the sides, can somebody help me with that?
 

GarbageHaus

Member
Sounds like the issue is determining the direction of the collision.

I'd recommend putting code in the collision event that checks to see if the oPlayer.y value is less than the oGoomba.y value. If the player's y is lower, they must therefore be higher, and should be "stomped" this way.
 
Sounds like the issue is determining the direction of the collision.

I'd recommend putting code in the collision event that checks to see if the oPlayer.y value is less than the oGoomba.y value. If the player's y is lower, they must therefore be higher, and should be "stomped" this way.
thanks I will try that
 

TheouAegis

Member
You check if player's yprevious is less than Goomba's bbox_top AND if player's vspeed (or vspd or vsp or whatever variable you used) is greater than 0.
 
Sounds like the issue is determining the direction of the collision.

I'd recommend putting code in the collision event that checks to see if the oPlayer.y value is less than the oGoomba.y value. If the player's y is lower, they must therefore be higher, and should be "stomped" this way.
it worked thanks!
 
Top