Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. ///Movement
  2.  
  3. if keyboard_check(key_forward) and !keyboard_check(key_backward)
  4. {
  5. if place_free(x+movespeed+1*movedir,y)
  6. {
  7. if movedir = 1 and movespeed < movespeed_cap
  8. {
  9. if gravity = 0
  10. {movespeed += .5}
  11. if gravity > 0
  12. {movespeed += .25}
  13. }
  14. if movedir = -1 and movespeed > movespeed_cap*-1
  15. {
  16. if gravity = 0
  17. {movespeed -= .5}
  18. if gravity > 0
  19. {movespeed -= .25}
  20. }
  21. }
  22. }
  23.  
  24. if keyboard_check_pressed(key_jump) and jump = 1 and wall_cling = 0 and !input_pressmulti(key_jump,key_down,-2,-2,-2)
  25. {
  26. vspeed = 0
  27. vspeed -= 3.5 ; jump = 2
  28. }
  29. if keyboard_check_pressed(key_jump) and jump = 0 and wall_cling = 0 and !input_pressmulti(key_jump,key_down,-2,-2,-2)
  30. {
  31. vspeed = 0
  32. vspeed -= 4 ; jump = 1
  33. }
  34.  
  35. if keyboard_check_pressed(key_jump) and wall_cling = 1
  36. {
  37. vspeed = 0
  38. vspeed -= 3
  39. movespeed = -3
  40. endlag = 15
  41. wall_cling = 0
  42. movedir = -1
  43. }
  44.  
  45. if keyboard_check_pressed(key_jump) and wall_cling = -1
  46. {
  47. vspeed = 0
  48. vspeed -= 3
  49. movespeed = 3
  50. endlag = 15
  51. wall_cling = 0
  52. movedir = 1
  53. }
  54.  
  55. if keyboard_check_released(key_jump) and gravity > 0 and vspeed < 0
  56. {
  57. vspeed /= 2
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement