I'm currently attempting to implement a factory method pattern for creating multiple different enemies after loading data from a file. But I'm having second thoughts on what would be the best design pattern to implement or if in fact I am even using it correctly, below is how I intended to use it:
The Enemyfactory determines which enemy to create according to enemy type specified in the xml level file. For example:
<enemy>
<type>
NORMAL
</type>
...
</enemy>
<enemy>
<type>
BRAWLER
</type>
...
</enemy>
This data is read in the LevelLoader and then can be used to construct enemies. In the LevelLoader class I could easily have somehting like this instead:
if(node.equal("NORMAL")){
return new NormalEnemy(//parameters from file to construct enemies);
}else if (node.equal("BRAWLER")) {
return new BrawlerEnemy();
}
With this information, what would be the best way/best design pattern to use to create multiple enemies.