Advertisement
Guest User

Untitled

a guest
Sep 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. press_right = keyboard_check(vk_right);
  2. press_left = keyboard_check(vk_left);
  3. press_jump = keyboard_check_pressed(vk_space);
  4.  
  5.  
  6. var move = press_right - press_left;
  7. hspd = move * walkspd;
  8. vspd = vspd + grav;
  9.  
  10. if (place_meeting(x, y + 1, oNeige)) && (press_jump)
  11. {
  12. vspd = -7;
  13. }
  14.  
  15. // Collison Horizontales
  16.  
  17. if (place_meeting(x + hspd, y, oNeige))
  18. {
  19. while (!place_meeting(x + sign(hspd), y, oNeige))
  20. {
  21. x = x + sign(hspd);
  22. }
  23. hspd = 0;
  24. }
  25. x = x + hspd;
  26.  
  27. // Collision Verticales
  28.  
  29. if (place_meeting(x, y + vspd, oNeige))
  30. {
  31. while (!place_meeting(x, y + sign(vspd), oNeige))
  32. {
  33. y = y + sign(vspd);
  34. }
  35. vspd = 0;
  36. }
  37.  
  38. y = y + vspd;
  39. {
  40.  
  41. if (hspd != 0) image_xscale = sign(hspd);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement