diff --git a/base/Base.gd b/base/Base.gd index d20ae10..ee462bf 100644 --- a/base/Base.gd +++ b/base/Base.gd @@ -13,7 +13,6 @@ func change_scene(path: String): func start_game(): print("Starting game...") - Singletons.score = 0 change_scene("res://island/Island.tscn") diff --git a/island/Temple.gd b/island/Temple.gd index a68e97a..c0bdf6f 100644 --- a/island/Temple.gd +++ b/island/Temple.gd @@ -1,8 +1,9 @@ extends Node3D -var score = 0 -var exploded = false +var score: int = 0 +var time: float = 0.0 +var exploded: bool = false @export var size_per_prayer: float = 0.05 @export var pitch_per_prayer: float = 0.02 @@ -47,9 +48,15 @@ func try_to_explode(): func win(): print("YOU WIN!") + print("Time: ", time) queue_free() +func _process(delta): + if not exploded: + time += delta + + func _physics_process(_delta): try_to_collect_fruit() try_to_explode()