public static BatEnemyRepresentation CreateBatRepresentation(BatEnemy enemy, EnemyEvent enemyEvent, ContentManager content) { BatEnemyRepresentation enemyRepresentation = new BatEnemyRepresentation(enemy, enemyEvent); enemyRepresentation.LoadContent(content); return(enemyRepresentation); }
private void spawnBatEnemyAt(int x, int y) { EnemyEvent enemyEvent = new EnemyEvent(); Vector2 tilePosition = calculateTilePosition(x, y); BatEnemy enemy = EnemyFactory.CreateBatEntity(world, enemyEvent, tilePosition); BatEnemyRepresentation enemyRepresentation = EnemyFactory.CreateBatRepresentation(enemy, enemyEvent, representationManager.Content); BatEnemyController enemyController = EnemyFactory.CreateBatController(enemy); spawnEnemy(enemy, enemyRepresentation, enemyController); }
public static BatEnemy CreateBatEntity(World world, EnemyEvent enemyEvent, Vector2 enemyPosition) { ConfigFile configFile = Enemy.GetEnemyConfigFile(); int health = configFile.SettingGroups[batGeneralSettings].Settings["health"].GetValueAsInt(); float hitDelay = configFile.SettingGroups[batGeneralSettings].Settings["hitDelay"].GetValueAsFloat(); float recoveryDelay = configFile.SettingGroups[batGeneralSettings].Settings["recoveryDelay"].GetValueAsFloat(); BatEnemy enemy = new BatEnemy(world, enemyEvent); enemy.SetUpEnemy(enemyPosition, health, hitDelay, recoveryDelay); return(enemy); }
public static BatEnemyController CreateBatController(BatEnemy enemy) { BatEnemyController enemyController = new BatEnemyController(enemy); return(enemyController); }