21 lines
372 B
GDScript
21 lines
372 B
GDScript
extends Control
|
|
|
|
export(NodePath) var label_nodepath
|
|
|
|
const SCORE = 100
|
|
|
|
var _labelScore: Label
|
|
var _score: int = 0
|
|
|
|
|
|
func _ready():
|
|
_labelScore = get_node(label_nodepath) as Label
|
|
assert(null != _labelScore)
|
|
|
|
|
|
func increaseScore():
|
|
_score += SCORE
|
|
_labelScore.text = "Score: " + String(_score)
|
|
if (_score / SCORE == Collector.getCount()):
|
|
Logger.info("YOU WON!")
|
|
|