mirror of
https://github.com/RYGhub/the-cold-night.git
synced 2024-11-22 04:34:19 +00:00
🔧 Fix RNGs
This commit is contained in:
parent
b60997203f
commit
e08870b788
2 changed files with 9 additions and 7 deletions
|
@ -5,7 +5,12 @@ export var movement_per_second: float = 16.0
|
||||||
|
|
||||||
|
|
||||||
onready var target: KinematicBody2D = get_parent()
|
onready var target: KinematicBody2D = get_parent()
|
||||||
onready var rng = RandomNumberGenerator.new()
|
var rng: RandomNumberGenerator
|
||||||
|
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
rng = RandomNumberGenerator.new()
|
||||||
|
rng.randomize()
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(_delta):
|
func _physics_process(_delta):
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
extends Sprite
|
extends Sprite
|
||||||
|
|
||||||
var rng : RandomNumberGenerator = RandomNumberGenerator.new()
|
var rng: RandomNumberGenerator
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
rng = RandomNumberGenerator.new()
|
||||||
rng.randomize()
|
rng.randomize()
|
||||||
self.rotate(rng.randf_range(0,360))
|
self.rotate(rng.randf() * 2 * PI)
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
#func _process(delta):
|
|
||||||
# pass
|
|
||||||
|
|
Loading…
Reference in a new issue