godot-shooter / commit
Created asteroids have a random spin and velocity.
scenes/World.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenes/World.gd b/scenes/World.gd index e29c720..75178fa 100644 --- a/scenes/World.gd +++ b/scenes/World.gd @@ -102,8 +102,8 @@ func create_asteroid() -> Asteroid: var asteroid: Asteroid = Asteroid.instance() asteroid.position = get_new_environment_position(randf() * 2) asteroid.spin_rate = randf() * 2 - 1 - asteroid.scale *= (randf() * .5 + .75) -# asteroid.velocity = Vector2.UP.rotated(randf() * PI * 2) * randf() * 30 + asteroid.scale *= (randf() * 2 + .5) + asteroid.velocity = Vector2.UP.rotated(randf() * PI * 2) * randf() * 100 return asteroid func get_new_item_pos(dist_ratio: float = 1.0) -> Vector2: