if object == ship then
# The ship is invincible
# TODO health and losing
+ ship.hit
else
object.destroy
end
# Realistic rotation, kept for reference and reality minded individuals
#var r = applied_rotation * 0.2
#rotation_inertia += r
- #rotation_inertia = rotation_inertia.min(2.0).max(-2.0)
+ #rotation_inertia = rotation_inertia.clamp(-2.0, 2.0)
# Inertia to position
rotation += rotation_inertia * dt
world.objects.add bullet
world.bullets.add bullet
end
+
+ # Something hits the ship
+ fun hit do end
end
# Asteroid, the main obstacle in this game