Example #1
0
        public static BatEnemyRepresentation CreateBatRepresentation(BatEnemy enemy, EnemyEvent enemyEvent, ContentManager content)
        {
            BatEnemyRepresentation enemyRepresentation = new BatEnemyRepresentation(enemy, enemyEvent);

            enemyRepresentation.LoadContent(content);

            return(enemyRepresentation);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        public static BatEnemyController CreateBatController(BatEnemy enemy)
        {
            BatEnemyController enemyController = new BatEnemyController(enemy);

            return(enemyController);
        }