Advertisement
JohnSEBEKS

GunPickup

Feb 4th, 2020
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create Event:
  2.  
  3. execute code:
  4.  
  5. image_index = choose(0, 1, 2);
  6. image_speed = 0;
  7. image_angle = random(360);
  8. // Spin direction
  9. dir = choose(-1, 1);
  10.  
  11. Step Event:
  12.  
  13. execute code:
  14.  
  15. // Rotate when thrown
  16. image_angle += (3 * speed) * dir;
  17.  
  18. // Friction
  19. speed = Approach(speed, 0, 0.25);
  20.  
  21. Collision Event with object enemypar:
  22.  
  23. execute code:
  24.  
  25. // Bounce off wall and increase friction
  26. move_bounce_solid(true);
  27. speed *= 0.5;
  28.  
  29. // Switch rotate direction
  30. dir *= -1;
  31.  
  32. Collision Event with object obj_wallCol:
  33.  
  34. execute code:
  35.  
  36. // Bounce off wall and increase friction
  37. move_bounce_solid(true);
  38. speed *= 0.5;
  39.  
  40. // Switch rotate direction
  41. dir *= -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement