Step_0.gml 653 B

1234567891011121314151617181920212223242526272829303132333435
  1. if image_index + animation_spd < image_number
  2. image_index += animation_spd;
  3. if apply_gravity
  4. y_spd += global.g * global.time_scale;
  5. if place_meeting(x, y + y_spd, oParentSolid)
  6. {
  7. while !place_meeting(x, y + sign(y_spd), oParentSolid)
  8. y += sign(y_spd);
  9. if y_spd > 2
  10. {
  11. y_spd *= -restitution;
  12. x_spd *= restitution;
  13. }
  14. else
  15. {
  16. y_spd = 0;
  17. x_spd = 0;
  18. }
  19. }
  20. y += y_spd * global.time_scale;
  21. if place_meeting(x + x_spd, y, oParentSolid)
  22. x_spd *= -restitution;
  23. x += x_spd * global.time_scale;
  24. image_angle += point_distance(0, 0, x_spd, y_spd);
  25. image_alpha -= 0.001;//
  26. if image_alpha <= 0
  27. instance_destroy();