Add score for ball exchange
This commit is contained in:
parent
582a39992c
commit
40525022d7
6 changed files with 70 additions and 1 deletions
4
scripts/hud.gd
Normal file
4
scripts/hud.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends CanvasLayer
|
||||
|
||||
func update_score(score):
|
||||
$ScoreLabel.text = str(score)
|
7
scripts/main.gd
Normal file
7
scripts/main.gd
Normal file
|
@ -0,0 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
var score = 0
|
||||
|
||||
func _on_player_hit_ball():
|
||||
score += 1
|
||||
$HUD.update_score(score)
|
Loading…
Add table
Add a link
Reference in a new issue