Repository navigation
Enemy Factory
EnemyFactory creates enemy entities for the game. It loads stats and behaviour values from configs/Enemies.json and returns fully configured entities ready to be spawned by a game area. All enemy types share a common base, with specific methods for each type with different sprites and attack behaviour.
source/core/src/main/com/csse3200/game/entities/factories/EnemyFactory.java
EnemyFactory is a static utility class and can't be instantiated. Call the creation method for the enemy type you want.
Entity shooter = EnemyFactory.createSkeletonArcher(player);
spawnEntityAt(shooter, randomPos, true, true);The returned entity isn't registered with the game so you have to spawn it through your game area as shown above. Textures must be loaded beforehand so add images/skeleton_archer.png and images/arrow.png to the texture list.
| Type | Method | Attack |
|---|---|---|
| Skeleton Warrior | createSkeletonWarrior |
Melee, with wind-up delay |
| Skeleton Archer | createSkeletonArcher |
Ranged projectile |
- Add a config block to
configs/Enemies.json - Add a matching field to
EnemyConfigs - Add the sprite to
source/core/assets/images - Add a
createX(Entity target)method toEnemyFactoryfollowing the current pattern: callcreateEnemy, add aTextureRenderComponent, callscaleEntity(), and add any specific type of attack. - Register the new texture in the game area's texture list
Entities and Components
Input Handling
Arrow Selection Wheel Arrow Selection Wheel — Sprint 3