Exemplo n.º 1
0
 public BonusesPopulationController(int maxBonusesCount, World world,
     IEnumerable<Point> bonusesGenerationPoints)
 {
     World = world;
     MaxBonusesCount = maxBonusesCount;
     BonusesGenerationPoints = new List<Point>(bonusesGenerationPoints);
 }
Exemplo n.º 2
0
 public EnemiesPopulationController(int maxEnemiesCount, World world,
     IEnumerable<Point> enemiesGenerationPoints)
 {
     World = world;
     MaxEnemiesCount = maxEnemiesCount;
     EnemiesGenerationPoints = new List<Point>(enemiesGenerationPoints);
 }
Exemplo n.º 3
0
 public LevelScene(MainMenuScene owner)
 {
     _world = new World();
     _worldView = new WorldView(_world);
     _mainMenuScene = owner;
 }
Exemplo n.º 4
0
 private void DrawWorldEvents(Canvas2D canvas, World world)
 {
     DrawBonusBoom(canvas, world);
     DrawGameOver(canvas, world);
     DrawPlayerLife(canvas, world);
     DrawPlayerScore(canvas, world);
     DrawLevelInfo(canvas, world);
 }
Exemplo n.º 5
0
 public WorldView(World world)
 {
     World = world;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 10
0
 private void DrawGameOver(Canvas2D canvas, World world)
 {
     if (World.Player.Life.Count == 0)
     {
         DrawTempEvent(canvas, world, "GAME OVER");
     }
 }
Exemplo n.º 11
0
 private void DrawBonusBoom(Canvas2D canvas, World world)
 {
     if (World.WorldState.BonusExplosion)
     {
         m_renderer.ActivateShackeEffect(WorldRenderer.ShakeStrength * 5,
             WorldRenderer.ShakeMinimizingSpeed + WorldRenderer.ShakeMinimizingSpeed);
     }
 }
Exemplo n.º 12
0
 public WorldState(World world)
 {
     World = world;
     LevelNumber = 1;
 }