Coin + Countdown Timer

Added a coin for player to pick up and a countdown timer
This commit is contained in:
tiffanyfrias10
2021-11-23 11:27:33 -06:00
parent d4302081be
commit 85ee3e7a07
7 changed files with 154 additions and 1 deletions

27
Countdown.gd Normal file
View File

@@ -0,0 +1,27 @@
extends Control
export (int) var minutes =0
export (int) var seconds = 0
var dsec = 0
func _physics_process(delta: float) -> void:
if seconds > 0 and dsec <= 0:
seconds -=1
dsec = 10
if minutes > 0 and seconds <= 0:
minutes -= 1
seconds = 60
if seconds >= 10:
$sec.set_text(str(seconds))
else:
$sec.set_text("0"+str(seconds))
if dsec >=10:
$dsec.set_text(str(dsec))
else:
$dsec.set_text("0" + str(dsec))
func _on_Timer_timeout() -> void:
dsec-=1
pass # Replace with function body.