Add score for ball exchange

This commit is contained in:
Mathilde Grapin 2023-07-01 19:30:26 +02:00
parent 582a39992c
commit 40525022d7
6 changed files with 70 additions and 1 deletions

4
scripts/hud.gd Normal file
View file

@ -0,0 +1,4 @@
extends CanvasLayer
func update_score(score):
$ScoreLabel.text = str(score)

7
scripts/main.gd Normal file
View file

@ -0,0 +1,7 @@
extends Node2D
var score = 0
func _on_player_hit_ball():
score += 1
$HUD.update_score(score)