public static void AddEnemy(Vector2 squareLocation)
 {
     int startX = (int)squareLocation.X;
     int startY = (int)squareLocation.Y;
     Rectangle squareRect = TileMap.SquareWorldRectangle(startX, startY);
     Enemy newEnemy = new Enemy(new Vector2(squareRect.X, squareRect.Y), enemyTexture, enemyInitialFrame);
     newEnemy.currentTargetSquare = squareLocation;
     Enemies.Add(newEnemy);
 }
Beispiel #2
0
        private static void CheckPlayerImpact(Enemy enemy)
        {
            if (enemy.Destroyed)
            {
                return;
            }

            if(enemy.EnemyBase.IsCircleColliding(Player.BaseSprite.WorldCenter, Player.BaseSprite.CollisionRadius))
            {
                enemy.Destroyed = true;
                EffectsManager.AddExplosion(enemy.EnemyBase.WorldCenter, enemy.EnemyBase.Velocity/30);
                EffectsManager.AddExplosion(Player.BaseSprite.WorldCenter, Vector2.Zero);
            }
        }