Plant spawn
This commit is contained in:
parent
32453f2e9d
commit
941912d7f1
25 changed files with 281 additions and 40 deletions
|
|
@ -5,6 +5,8 @@ class_name Entity
|
|||
|
||||
## Maximum health points of an entity. Any heal cannot exceed this value
|
||||
@export var max_hp : float
|
||||
## Optional spawn layer for grid interactions
|
||||
@export var layer : StringName = ""
|
||||
## Current amount of health points of an entity. Cannot be below 0 or [code]max_hp[/code]
|
||||
var hp : float = max_hp
|
||||
|
||||
|
|
@ -67,6 +69,10 @@ func kill(source : Entity):
|
|||
context.target = self
|
||||
killed.emit(context)
|
||||
|
||||
LevelEventBus.entity_killed.emit(context)
|
||||
if not layer.is_empty():
|
||||
LevelEventBus.layer_entity_killed.emit(context)
|
||||
|
||||
deconstruct()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue