From 92da2106d03973ce067b6eb3fb52bd2201c5b945 Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Tue, 4 Apr 2023 16:21:30 -0400 Subject: [PATCH] fixed bug where acab shard was given every frame --- maps/station.gd | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/maps/station.gd b/maps/station.gd index 53dce3f..6e2c912 100644 --- a/maps/station.gd +++ b/maps/station.gd @@ -1,9 +1,13 @@ extends "res://maps/map.gd" +var acab_shard_has_been_collected = false + func _physics_process(delta): ._physics_process(delta) if get_tree().get_nodes_in_group("cop").size() == 0: - Audio.play_shard_sound() - Game.score += 500 - Game.shards += 1 - Game.shards_collected[0] = true + if !acab_shard_has_been_collected: + Audio.play_shard_sound() + Game.score += 500 + Game.shards += 1 + Game.shards_collected[0] = true + acab_shard_has_been_collected = true