24 lines
593 B
GDScript3
24 lines
593 B
GDScript3
|
extends Node
|
||
|
|
||
|
var player: Resource
|
||
|
var coinCollectedTotal:int = 0
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
print("GameManager is here!")
|
||
|
player = load("res://scripts/resources/player_stats.tres")
|
||
|
|
||
|
func coinCollected():
|
||
|
coinCollectedTotal +=1
|
||
|
print("coins collected "+str(coinCollectedTotal) )
|
||
|
|
||
|
func playerDamage():
|
||
|
player.health -= 20
|
||
|
print("Player health is now "+str(player.health) )
|
||
|
func resetPlayer():
|
||
|
player.health = player.max_health
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
pass
|