2024-08-20 01:09:36 +00:00
|
|
|
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
|
2024-09-03 03:01:45 +00:00
|
|
|
|
|
|
|
func resetCoinCollectedCount():
|
|
|
|
coinsCollectedTotal = 0
|
2024-08-20 01:09:36 +00:00
|
|
|
|
|
|
|
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
|