Skip to content

Commit

Permalink
Added a score counting system
Browse files Browse the repository at this point in the history
  • Loading branch information
Plexi09 committed Jun 8, 2024
1 parent c68c126 commit 9a213e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/coin.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends Area2D


@onready var game_manager = %GameManager

func _on_body_entered(body):
queue_free()
game_manager.add_point()
7 changes: 7 additions & 0 deletions scripts/game_manager.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Node

var score = 0

func add_point():
score += 1
print(score)

0 comments on commit 9a213e8

Please sign in to comment.