Step_0.gml 536 B

1234567891011121314151617181920212223242526272829
  1. event_inherited();
  2. y_spd += global.g * global.time_scale;
  3. if place_meeting(x, y + y_spd, oParentSolid)
  4. {
  5. while !place_meeting(x, y + sign(y_spd), oParentSolid)
  6. y += sign(y_spd);
  7. if y_spd > 2
  8. {
  9. y_spd *= -restitution;
  10. x_spd *= restitution;
  11. }
  12. else
  13. {
  14. y_spd = 0;
  15. x_spd = 0;
  16. }
  17. }
  18. y += y_spd * global.time_scale;
  19. if place_meeting(x + x_spd, y, oParentSolid)
  20. x_spd *= -restitution;
  21. x += x_spd * global.time_scale;
  22. image_angle += 4 * point_distance(0, 0, x_spd, y_spd) * global.time_scale;