21 lines
372 B
GDScript3
Raw Normal View History

2019-11-23 13:23:00 +01:00
extends Control
export(NodePath) var label_nodepath
const SCORE = 100
var _labelScore: Label
var _score: int = 0
2019-11-23 13:23:00 +01:00
func _ready():
_labelScore = get_node(label_nodepath) as Label
assert(null != _labelScore)
2019-11-23 13:23:00 +01:00
func increaseScore():
_score += SCORE
_labelScore.text = "Score: " + String(_score)
if (_score / SCORE == Collector.getCount()):
Logger.info("YOU WON!")