Added Infinite Mode; Improved Timer
This commit is contained in:
parent
1245ebc9e8
commit
ed9f671256
9 changed files with 109 additions and 44 deletions
|
|
@ -32,6 +32,10 @@ var time = 60
|
|||
|
||||
var lost = false
|
||||
|
||||
enum MODES {INFINITE, TIME}
|
||||
|
||||
var currentMode = MODES.INFINITE
|
||||
|
||||
func getNewUID() -> int:
|
||||
lastUID += 1
|
||||
return lastUID
|
||||
|
|
@ -42,7 +46,7 @@ func resetGame():
|
|||
points = 0
|
||||
lastUID = 0
|
||||
currentUID = lastUID
|
||||
time = 60
|
||||
resetTime()
|
||||
lost = false
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -50,3 +54,18 @@ func _ready() -> void:
|
|||
|
||||
func lose():
|
||||
lost = true
|
||||
|
||||
func resetTime():
|
||||
time = 0
|
||||
|
||||
|
||||
func setTimeModeTimer():
|
||||
time = 60
|
||||
|
||||
func convertIntToTime(value) -> String:
|
||||
var time = str(value)
|
||||
var seconds = value % 60
|
||||
var minutes = value / 60
|
||||
if seconds < 10:
|
||||
seconds = "0"+ str(seconds)
|
||||
return str(minutes) + ":" + str(seconds)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue