forked from team-sg/hero-mark-2
added timer
This commit is contained in:
parent
969364ebce
commit
38ef040ae9
10 changed files with 28 additions and 6 deletions
|
@ -1,3 +1,3 @@
|
|||
source_md5="026ee7e1be4d0ee92d90c670bc3aebc6"
|
||||
dest_md5="85f358875be0cc04cc08969b6c60d8fd"
|
||||
source_md5="7b4e98ed7fdbd47d496d1542223b3061"
|
||||
dest_md5="ddc3228c927c9a31507b6b89ee41301a"
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
source_md5="fb67ed3d8705bb1b1df3f390f7c0a76e"
|
||||
dest_md5="7b559cefb37e265b48ad90421f94dcb4"
|
||||
source_md5="c0160f559a57791b0ab96a8c9ef45d0c"
|
||||
dest_md5="a40b0bbf70fb2e4f0d971d734f832ac1"
|
||||
|
||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ custom_features=""
|
|||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../demos/Hero Mark 2 2022 Demo/hero mark 2_win.exe"
|
||||
export_path="../output/test_build.exe"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4 KiB |
1
game.gd
1
game.gd
|
@ -14,6 +14,7 @@ var arrows = 0
|
|||
var score = 0
|
||||
var high_score = 0
|
||||
var lives = 2
|
||||
var time = 0.0
|
||||
#Audio Channels
|
||||
onready var ac_jump = $JumpSound
|
||||
onready var ac_collectible = $CollecitbleSound
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 734 B |
|
@ -11,6 +11,10 @@ onready var score_counter = $ScoreCounter
|
|||
onready var arrow_counter = $ArrowCounter
|
||||
onready var lives_counter = $LivesCounter
|
||||
onready var high_counter = $HighCounter
|
||||
onready var time_counter = $TimeCounter
|
||||
|
||||
func _ready():
|
||||
Game.time = 0
|
||||
|
||||
func _physics_process(delta):
|
||||
#Gold Counter
|
||||
|
@ -26,9 +30,18 @@ func _physics_process(delta):
|
|||
#Score Counter
|
||||
score_counter.text = "%06d" % Game.score
|
||||
#Arrow Counter
|
||||
arrow_counter.text = "%02d" % Game.arrows
|
||||
arrow_counter.text = str(Game.arrows)
|
||||
##TOUCH UP LATER
|
||||
#Lives counter
|
||||
lives_counter.text = str(Game.lives)
|
||||
#High counter
|
||||
high_counter.text = str("HIGH:") + str("%06d" % Game.high_score)
|
||||
##Timer
|
||||
Game.time += delta
|
||||
var minutes = str(floor(Game.time / 60))
|
||||
var seconds = floor(fmod(Game.time,60))
|
||||
var milliseconds := floor(fmod(Game.time, 1) * 100)
|
||||
if Game.time < 600:
|
||||
time_counter.text = minutes + ":" + ("%02d" % seconds) + ":" + ("%02d" % milliseconds)
|
||||
else:
|
||||
time_counter.text = "9:59:99"
|
||||
|
|
|
@ -110,3 +110,11 @@ margin_right = 152.0
|
|||
margin_bottom = 18.0
|
||||
theme = ExtResource( 10 )
|
||||
text = "0"
|
||||
|
||||
[node name="TimeCounter" type="Label" parent="HUD"]
|
||||
margin_left = 1.0
|
||||
margin_top = 178.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 198.0
|
||||
theme = ExtResource( 10 )
|
||||
text = "0:00:00"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue