26 lines
563 B
GDScript
26 lines
563 B
GDScript
extends Node
|
|
|
|
var player: Resource
|
|
var coinsCollectedTotal: int = 0
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
player = load("res://scripts/resources/playerStats.tres")
|
|
|
|
func coinCollected():
|
|
coinsCollectedTotal += 1
|
|
|
|
func resetCoinCollectedCount():
|
|
coinsCollectedTotal = 0
|
|
|
|
func playerDamage():
|
|
if player.currentHealth > 0:
|
|
player.currentHealth -= 20
|
|
|
|
func resetPlayer():
|
|
player.currentHealth = player.maxHealth
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
pass
|