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 rng = RandomNumberGenerator.new()
|
||||
var rng: RandomNumberGenerator
|
||||
|
||||
|
||||
func _ready():
|
||||
rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
|
||||
|
||||
func _physics_process(_delta):
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
extends Sprite
|
||||
|
||||
var rng : RandomNumberGenerator = RandomNumberGenerator.new()
|
||||
var rng: RandomNumberGenerator
|
||||
|
||||
func _ready():
|
||||
rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
self.rotate(rng.randf_range(0,360))
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
self.rotate(rng.randf() * 2 * PI)
|
||||
|
|
Loading…
Reference in a new issue