Fix memory leak and save file deletion + other stuff

might also be the commit where timer starts only when you move
This commit is contained in:
Taevas 2025-05-03 14:33:49 +02:00
parent 709ce8eea3
commit edf99640cf
Signed by: Taevas
SSH key fingerprint: SHA256:Y5Hv18xwPvUKSlgkx1sPnRO3L2mc03ehC7BzrnZVEyY
6 changed files with 45 additions and 57 deletions

View file

@ -17,6 +17,7 @@ var rings: Array[Ring] = []
var finished_rings_count: int = 0
var velocity: float = 0.0
var has_started_playing: bool = false
func _init() -> void:
assert(len(id) > 0, self.name + " has no id!")
@ -69,7 +70,9 @@ func _input(_event: InputEvent) -> void:
var down := Input.is_action_just_pressed("gravity_down")
if up or left or right or down:
started_playing.emit()
if !has_started_playing:
has_started_playing = true
started_playing.emit()
PhysicsServer3D.area_set_param(
get_viewport().find_world_3d().space,
PhysicsServer3D.AREA_PARAM_GRAVITY,