add collecting coins

This commit is contained in:
2024-12-30 01:00:26 +01:00
parent b862fa8084
commit d96963b6ef
14 changed files with 184 additions and 3 deletions

18
scripts/game_manager.gd Normal file
View File

@@ -0,0 +1,18 @@
class_name GM
extends Node
var player_state = {
"coins": 0,
}
func add_coins(amount: int) -> void:
player_state["coins"] += amount
func set_coins(amount: int) -> void:
player_state["coins"] = amount
func get_coins() -> int:
return player_state["coins"]
func remove_coins(amount: int) -> void:
player_state["coins"] -= amount