Skip to content

Enemy Manager Component

Yuri edited this page Sep 24, 2026 · 3 revisions

Enemy Manager Component

Current Room/item spawning contract: Spawning items from a room documents remote items@1ec91e64 for draft PR #198, including explicit spawnItem(...) calls and automatic enemy drops. The reward-policy description below records an older baseline.

Team 5 reward integration — remote items 9eb2186

Current EnemyManager spawns configured room entries and tracks active enemy entities. The Team 5 integration accepts a defeat once per tracked entity, selects 5 Gold plus a 35% optional consumable through EnemyDropPolicy, then defers factory creation/registration safely and owns the resulting drops until room cleanup. The policy values are configurable defaults.

entityDied and finalBossEncounterCompleted share the guard. Cerberus heads are individually tracked; do not interpret the guard as one reward for the entire boss encounter. Split-parent replacement and room disposal are also covered by the integration. See Team 5 rules and ownership and test evidence.

These Team 5 reward additions are published on items, not yet claimed as merged into main. Team 4 retains room/enemy lifecycle ownership.

Historical room-spawn description

The original description below refers to an older random-spawn implementation. Its method/counter names and enemy counts do not describe the current configured manager; retained here as historical text pending the room team's broader page revision.

A room component that spawns enemies and signals when the room has been cleared.

Each room entity carries an EnemyManagerComponent, which spawns enemies in the room on start, keeps a count of how many are alive and fires a "roomCleared" event when all enemies are dead.

On create(), spawnBombEnemies places a random number of enemies between 10 and 19 on random tiles. Each enemy is passed to track(), which increments the liveEnemies counter and calls onEnemyDefeated() on the enemie's "entityDied" event. As enemies die, the counter decrements and triggers "roomCleared" on the room when no live enemies remain.

Table of Contents

Home

Getting Started

Game Engine

Entities and Components
Input Handling

Features

Components
Achievements
Player
Items and Inventory
Enemies
Bosses
Interactable NPCs
Cutscenes and Dialogue
Music
Weapons
Abilities & Spells
Rooms and Dungeons
Game Screens and Areas
UI

Test Plans

Team 2

Troubleshooting

Clone this wiki locally