Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///enemyCollidePlayer()
- //Is the enemy stomped? Does the enemy hit the player?
- if dead == false //If we aren't already stomped
- {
- if other.y < y && other.vspeed > 0 //If the player touches us from above, and the player is moving down
- {
- dead = true; //We are stomped, therefore we are dead
- image_yscale = -1; //We are facing upside down
- vspeed = -5; //We are making a small hop
- if keyboard_check(other.keyJump) //If we are holding the jump key
- other.vspeed = abs(other.jumpHeight)*-1; //Bounce off the enemy at a high speed
- else //Else, if we are not holding the jump key
- other.vspeed = -3; //Bounce off the enemy at a low speed
- }
- else if other.canhit == true //If the player touches us from anywhere except above us, and the player can get hit
- {
- with other playerGetHit(); //The player gets hit
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment