1
Fork 0
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:
Steffo 2022-04-03 17:48:53 +02:00
parent b60997203f
commit e08870b788
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 9 additions and 7 deletions

View file

@ -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):

View file

@ -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)