예제 #1
0
 public BonusesPopulationController(int maxBonusesCount, World world,
     IEnumerable<Point> bonusesGenerationPoints)
 {
     World = world;
     MaxBonusesCount = maxBonusesCount;
     BonusesGenerationPoints = new List<Point>(bonusesGenerationPoints);
 }
예제 #2
0
 public EnemiesPopulationController(int maxEnemiesCount, World world,
     IEnumerable<Point> enemiesGenerationPoints)
 {
     World = world;
     MaxEnemiesCount = maxEnemiesCount;
     EnemiesGenerationPoints = new List<Point>(enemiesGenerationPoints);
 }
예제 #3
0
파일: LevelScene.cs 프로젝트: rinat/battle
 public LevelScene(MainMenuScene owner)
 {
     _world = new World();
     _worldView = new WorldView(_world);
     _mainMenuScene = owner;
 }
예제 #4
0
파일: WorldView.cs 프로젝트: rinat/battle
 private void DrawWorldEvents(Canvas2D canvas, World world)
 {
     DrawBonusBoom(canvas, world);
     DrawGameOver(canvas, world);
     DrawPlayerLife(canvas, world);
     DrawPlayerScore(canvas, world);
     DrawLevelInfo(canvas, world);
 }
예제 #5
0
파일: WorldView.cs 프로젝트: rinat/battle
 public WorldView(World world)
 {
     World = world;
 }
예제 #6
0
파일: WorldView.cs 프로젝트: rinat/battle
        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);
        }
예제 #7
0
파일: WorldView.cs 프로젝트: rinat/battle
 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);
 }
예제 #8
0
파일: WorldView.cs 프로젝트: rinat/battle
 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);
 }
예제 #9
0
파일: WorldView.cs 프로젝트: rinat/battle
 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);
 }
예제 #10
0
파일: WorldView.cs 프로젝트: rinat/battle
 private void DrawGameOver(Canvas2D canvas, World world)
 {
     if (World.Player.Life.Count == 0)
     {
         DrawTempEvent(canvas, world, "GAME OVER");
     }
 }
예제 #11
0
파일: WorldView.cs 프로젝트: rinat/battle
 private void DrawBonusBoom(Canvas2D canvas, World world)
 {
     if (World.WorldState.BonusExplosion)
     {
         m_renderer.ActivateShackeEffect(WorldRenderer.ShakeStrength * 5,
             WorldRenderer.ShakeMinimizingSpeed + WorldRenderer.ShakeMinimizingSpeed);
     }
 }
예제 #12
0
파일: WorldState.cs 프로젝트: rinat/battle
 public WorldState(World world)
 {
     World = world;
     LevelNumber = 1;
 }