Class EnemyFactory
java.lang.Object
com.deco2800.game.entities.factories.EnemyFactory
Factory to create non-playable character (NPC) entities with predefined components.
Each NPC entity type should have a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configs stored as json files which are defined in "EnemyConfigs".
If needed, this factory can be separated into more specific factories for entities with similar characteristics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateBlueJoker(AtlantisTerrainFactory terrainFactory) Creates a Blue Joker enemy entitystatic EntitycreateBullet(Entity from, Entity target, GameArea gameArea) Creates the bullet for the Trebuchet.static EntitycreateSnake(AtlantisTerrainFactory terrainFactory) Creates a Snake entitystatic EntitycreateTitan(AtlantisTerrainFactory terrainFactory) Creates a titan entitystatic EntitycreateWolf(AtlantisTerrainFactory terrainFactory) Creates a wolf entity
-
Method Details
-
createBullet
Creates the bullet for the Trebuchet.- Parameters:
from- the position of the Trebuchet that the bullet will be created fromtarget- the ships that the bullet aim to attackgameArea- the game area- Returns:
- the bullet entity of Trebuchet.
-
createBlueJoker
Creates a Blue Joker enemy entity- Returns:
- Blue Joker enemy entity
-
createSnake
Creates a Snake entity- Returns:
- Snake entity
-
createWolf
Creates a wolf entity- Returns:
- entity
-
createTitan
Creates a titan entity- Returns:
- entity
-