From 1cf4fff74a305a982a5b25aa484d81ec48a61025 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Mon, 27 Feb 2023 20:02:44 +0300 Subject: [PATCH] Remove unnecessary `randomize()` (#862) Seed is now automatically randomized on startup in Godot 4. --- 2d/bullet_shower/bullets.gd | 2 -- 2d/dodge_the_creeps/Main.gd | 4 ---- networking/webrtc_signaling/demo/client_ui.gd | 1 - viewport/dynamic_split_screen/wall_coloring.gd | 1 - 4 files changed, 8 deletions(-) diff --git a/2d/bullet_shower/bullets.gd b/2d/bullet_shower/bullets.gd index b1838231..e6a4266a 100644 --- a/2d/bullet_shower/bullets.gd +++ b/2d/bullet_shower/bullets.gd @@ -24,8 +24,6 @@ class Bullet: func _ready(): - randomize() - shape = PhysicsServer2D.circle_shape_create() # Set the collision shape's radius for each bullet in pixels. PhysicsServer2D.shape_set_data(shape, 8) diff --git a/2d/dodge_the_creeps/Main.gd b/2d/dodge_the_creeps/Main.gd index 0e851a71..3660e7d7 100644 --- a/2d/dodge_the_creeps/Main.gd +++ b/2d/dodge_the_creeps/Main.gd @@ -3,10 +3,6 @@ extends Node @export var mob_scene: PackedScene var score -func _ready(): - randomize() - - func game_over(): $ScoreTimer.stop() $MobTimer.stop() diff --git a/networking/webrtc_signaling/demo/client_ui.gd b/networking/webrtc_signaling/demo/client_ui.gd index 7dcd6ecc..8227b1f7 100644 --- a/networking/webrtc_signaling/demo/client_ui.gd +++ b/networking/webrtc_signaling/demo/client_ui.gd @@ -65,7 +65,6 @@ func _on_peers_pressed(): func _on_ping_pressed(): - randomize() ping.rpc(randf()) diff --git a/viewport/dynamic_split_screen/wall_coloring.gd b/viewport/dynamic_split_screen/wall_coloring.gd index 5dafe6b3..f1cfb1d1 100644 --- a/viewport/dynamic_split_screen/wall_coloring.gd +++ b/viewport/dynamic_split_screen/wall_coloring.gd @@ -5,7 +5,6 @@ extends Node3D # To use, attach this script to the "Walls" node. func _ready(): - randomize() var walls = get_tree().get_nodes_in_group("walls") for wall in walls: var material = StandardMaterial3D.new()