Guest User

Untitled

a guest
Sep 10th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. ///enemyCollidePlayer()
  2. //Is the enemy stomped? Does the enemy hit the player?
  3.  
  4. if dead == false //If we aren't already stomped
  5. {
  6. if other.y < y && other.vspeed > 0 //If the player touches us from above, and the player is moving down
  7. {
  8. dead = true; //We are stomped, therefore we are dead
  9.  
  10. image_yscale = -1; //We are facing upside down
  11. vspeed = -5; //We are making a small hop
  12.  
  13. if keyboard_check(other.keyJump) //If we are holding the jump key
  14. other.vspeed = abs(other.jumpHeight)*-1; //Bounce off the enemy at a high speed
  15. else //Else, if we are not holding the jump key
  16. other.vspeed = -3; //Bounce off the enemy at a low speed
  17. }
  18. else if other.canhit == true //If the player touches us from anywhere except above us, and the player can get hit
  19. {
  20. with other playerGetHit(); //The player gets hit
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment