public static WalkerEnemyRepresentation CreateWalkerRepresentation(WalkerEnemy enemy, EnemyEvent enemyEvent, ContentManager content) { WalkerEnemyRepresentation enemyRepresentation = new WalkerEnemyRepresentation(enemy, enemyEvent); enemyRepresentation.LoadContent(content); return(enemyRepresentation); }
private void spawnWalkerEnemyAt(int x, int y) { EnemyEvent enemyEvent = new EnemyEvent(); Vector2 tilePosition = calculateTilePosition(x, y); WalkerEnemy enemy = EnemyFactory.CreateWalkerEntity(world, enemyEvent, tilePosition); WalkerEnemyRepresentation enemyRepresentation = EnemyFactory.CreateWalkerRepresentation(enemy, enemyEvent, representationManager.Content); WalkerEnemyController enemyController = EnemyFactory.CreateWalkerController(enemy); spawnEnemy(enemy, enemyRepresentation, enemyController); }
public static WalkerEnemy CreateWalkerEntity(World world, EnemyEvent enemyEvent, Vector2 enemyPosition) { ConfigFile configFile = Enemy.GetEnemyConfigFile(); int health = configFile.SettingGroups[walkerGeneralSettings].Settings["health"].GetValueAsInt(); float hitDelay = configFile.SettingGroups[walkerGeneralSettings].Settings["hitDelay"].GetValueAsFloat(); float recoveryDelay = configFile.SettingGroups[walkerGeneralSettings].Settings["recoveryDelay"].GetValueAsFloat(); WalkerEnemy enemy = new WalkerEnemy(world, enemyEvent); enemy.SetUpEnemy(enemyPosition, health, hitDelay, recoveryDelay); return(enemy); }
public static WalkerEnemyController CreateWalkerController(WalkerEnemy enemy) { WalkerEnemyController enemyController = new WalkerEnemyController(enemy); return(enemyController); }