File size: 315 Bytes
8f07272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extends Node

@export var starting_hp = 30
var hp = starting_hp

var player : Player = null

func init(p):
	player = p
	
func reset():
	hp = starting_hp
	
func take_damage(damage):
	hp -= damage
	#prints("take damage", hp, damage, hp <= 0)
	if hp <= 0:
		die()
	
func die():
	player.died()
	#print("player died")