Exemplo n.º 1
0
        public WorldController()
        {
            worldUI = new WorldUI(this);

            enemies = new List <EnemyController>();
            bigdots = new List <BigDotController>();
            tiles   = new List <TileController>();
            pacdots = new List <PacDotController>();

            //draw the world
            ready           = new ReadyController(); //adds ready text
            ready.view.Top  = 177;
            ready.view.Left = 125;
            this.view.Controls.Add(ready.view);

            player = new PlayerController(ready);//adds player
            player.subscribeObserver(this);
            this.DrawPlayer();
            this.view.Controls.Add(player.view);

            beginTile         = new TileController(); //adds begintile for enemies
            beginTile.Model.X = 9;
            beginTile.Model.Y = 9;

            score          = new ScoreController(); //adds score
            score.view.Top = 340;
            this.view.Controls.Add(score.view);

            lives           = new LivesController(); //adds lives to the form
            lives.view.Top  = 340;
            lives.view.Left = 190;
            this.view.Controls.Add(lives.view);
            player.subscribeObserver(lives);

            gameOver           = new GameOverController(); //adds game over text
            gameOver.view.Top  = 177;
            gameOver.view.Left = 111;
            this.view.Controls.Add(gameOver.view);
            lives.subscribeObserverToLives(gameOver);
            gameOver.SubscribeObserver(this);
            gameOver.GameOverTextVisible(false);


            drawMap(true);
            DrawEnemies(false);

            for (int i = 0; i < bigdots.Count; i++) //Subscribe all the enemies to each bigdot
            {
                for (int j = 0; j < enemies.Count; j++)
                {
                    bigdots[i].subscribeObserverToBigDot(enemies[j]);
                }
            }
        }
Exemplo n.º 2
0
 public GameOverUI(GameOverController controller)
 {
     gameOverController = controller;
     InitializeComponent();
     gameOverLabel.Font = LoadFont.loadFont(10);
 }