(wip) Food spawning on prey death

This commit is contained in:
2026-02-07 17:42:57 +01:00
parent 9c625edef4
commit 1dc1501b80
4 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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: