Guest User

Untitled

a guest
Jun 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. if direction >= 45 && direction < 135
  2. {
  3. back = true
  4. }
  5. else
  6. {
  7. back = false
  8. }
  9.  
  10. if direction >= 135 && direction < 225
  11. {
  12. left = true
  13. }
  14. else
  15. {
  16. left = false
  17. }
  18.  
  19. if direction >= 225 && direction < 315
  20. {
  21. forward = true
  22. }
  23. else
  24. {
  25. forward = false
  26. }
  27.  
  28. if direction >= 315 && direction < 45
  29. {
  30. right = true
  31. }
  32. else
  33. {
  34. right = false
  35. }
  36.  
  37.  
  38. if mouse_check_button_pressed(mb_left)
  39. {
  40. movetox = mouse_x
  41. movetoy = mouse_y
  42. moving = true
  43. }
  44.  
  45. speed = 3
  46. direction = point_direction(x,y,movetox,movetoy)
  47. speed = min(3,point_distance(x,y,movetox,movetoy)/2)
  48.  
  49. if speed < 0.1
  50. {
  51. speed = 0
  52. moving = false
  53. }
Add Comment
Please, Sign In to add comment