public BonusesPopulationController(int maxBonusesCount, World world,
     IEnumerable<Point> bonusesGenerationPoints)
 {
     World = world;
     MaxBonusesCount = maxBonusesCount;
     BonusesGenerationPoints = new List<Point>(bonusesGenerationPoints);
 }
 public EnemiesPopulationController(int maxEnemiesCount, World world,
     IEnumerable<Point> enemiesGenerationPoints)
 {
     World = world;
     MaxEnemiesCount = maxEnemiesCount;
     EnemiesGenerationPoints = new List<Point>(enemiesGenerationPoints);
 }
Example #3
0
 public LevelScene(MainMenuScene owner)
 {
     _world = new World();
     _worldView = new WorldView(_world);
     _mainMenuScene = owner;
 }
Example #4
0
 private void DrawWorldEvents(Canvas2D canvas, World world)
 {
     DrawBonusBoom(canvas, world);
     DrawGameOver(canvas, world);
     DrawPlayerLife(canvas, world);
     DrawPlayerScore(canvas, world);
     DrawLevelInfo(canvas, world);
 }
Example #5
0
 public WorldView(World world)
 {
     World = world;
 }
Example #6
0
        private void DrawPlayerScore(Canvas2D canvas, World world)
        {
            float scoresHeight = (world.Height * TileSize) - HalfTileSize;
            string text = "Score " + World.Player.Score.Count;

            Vector textSize = canvas.MeasureString(Fonts.Instance.TanksSmallFont, text);
            canvas.DrawString(Fonts.Instance.TanksAltFont,
                new Vector(TileSize, World.Height * TileSize - HalfTileSize),
                text, ColorU.White);
        }
Example #7
0
 private void DrawTempEvent(Canvas2D canvas, World world, string text)
 {
     Vector textSize = canvas.MeasureString(Fonts.Instance.TankBigFont, text);
     canvas.DrawString(Fonts.Instance.TankBigFont, (canvas.Size - textSize) / 2, text, ColorU.Yellow);
 }
Example #8
0
 private void DrawPlayerLife(Canvas2D canvas, World world)
 {
     float extrasHeight = (world.Height * TileSize) - HalfTileSize;
     string text = "Life " + World.Player.Life.Count;
     Vector textSize = canvas.MeasureString(Fonts.Instance.TanksSmallFont, text);
     canvas.DrawString(Fonts.Instance.TanksAltFont,
         new Vector((world.Width * TileSize - HalfTileSize) - textSize.X, extrasHeight),
         text, ColorU.White);
 }
Example #9
0
 private void DrawLevelInfo(Canvas2D canvas, World world)
 {
     float extrasHeight = TileSize - HalfTileSize;
     string text = "Level " + World.WorldState.LevelNumber;
     Vector textSize = canvas.MeasureString(Fonts.Instance.TanksSmallFont, text);
     canvas.DrawString(Fonts.Instance.TanksAltFont,
         new Vector(((world.Width / 2) * TileSize) + textSize.X, extrasHeight),
         text, ColorU.White);
 }
Example #10
0
 private void DrawGameOver(Canvas2D canvas, World world)
 {
     if (World.Player.Life.Count == 0)
     {
         DrawTempEvent(canvas, world, "GAME OVER");
     }
 }
Example #11
0
 private void DrawBonusBoom(Canvas2D canvas, World world)
 {
     if (World.WorldState.BonusExplosion)
     {
         m_renderer.ActivateShackeEffect(WorldRenderer.ShakeStrength * 5,
             WorldRenderer.ShakeMinimizingSpeed + WorldRenderer.ShakeMinimizingSpeed);
     }
 }
Example #12
0
 public WorldState(World world)
 {
     World = world;
     LevelNumber = 1;
 }