1
0

Step_0.gml 591 B

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