fuzzyworld

godot-shooter / commit

Created asteroids have a random spin and velocity.

5d08c5b867dc15257f53d5c1de85caf2c77e56f9 · Pavel Safronov · 2023-12-21 14:14:59 -0800 · parents d706f2f116c8

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: