You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Call randomize() automatically
This commit is contained in:
@@ -804,10 +804,7 @@
|
|||||||
<method name="randomize">
|
<method name="randomize">
|
||||||
<description>
|
<description>
|
||||||
Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
|
Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
|
||||||
[codeblock]
|
[b]Note:[/b] This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use [method seed] to initialize the random number generator.
|
||||||
func _ready():
|
|
||||||
randomize()
|
|
||||||
[/codeblock]
|
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="range_lerp">
|
<method name="range_lerp">
|
||||||
|
|||||||
@@ -1349,6 +1349,8 @@ SceneTree::SceneTree() {
|
|||||||
|
|
||||||
GLOBAL_DEF("debug/shapes/collision/draw_2d_outlines", true);
|
GLOBAL_DEF("debug/shapes/collision/draw_2d_outlines", true);
|
||||||
|
|
||||||
|
Math::randomize();
|
||||||
|
|
||||||
// Create with mainloop.
|
// Create with mainloop.
|
||||||
|
|
||||||
root = memnew(Window);
|
root = memnew(Window);
|
||||||
|
|||||||
Reference in New Issue
Block a user