(wip) Food spawning on prey death
This commit is contained in:
@@ -47,4 +47,3 @@ func _on_entity_consumed() -> void:
|
||||
_currentCount = max(0, _currentCount-1)
|
||||
call_deferred("_spawn_minimum")
|
||||
|
||||
# TODO: Spawn food when an entity (any) dies
|
||||
|
||||
@@ -127,6 +127,6 @@ metadata/_custom_type_script = "uid://coetidfssb80w"
|
||||
|
||||
[node name="FoodManager" type="Node" parent="." unique_id=449460585]
|
||||
script = ExtResource("8_mys4o")
|
||||
foodTypes = [ExtResource("9_ojt85")]
|
||||
foodTypes = Array[PackedScene]([ExtResource("9_ojt85")])
|
||||
foodProbs = Array[float]([1.0])
|
||||
metadata/_custom_type_script = "uid://7ua0qgyhphao"
|
||||
|
||||
@@ -40,6 +40,7 @@ func handle_damage(dmg: int, src: Node) -> void:
|
||||
func die() -> void:
|
||||
sprite.play("Dying")
|
||||
wrapper.play_sprite("Dying")
|
||||
GameManager.foodManager._spawn_food(position)
|
||||
super.die()
|
||||
|
||||
func become_injured() -> void:
|
||||
|
||||
Reference in New Issue
Block a user