Esempio n. 1
0
        public Program()
        {
            this.IsMouseVisible = true;
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;

            //Give make the graphics render at the Screen Height and Width.
            graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
            graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;

            if (!graphics.IsFullScreen)
            {
                graphics.PreferredBackBufferHeight = (int)(graphics.PreferredBackBufferHeight / 1.5);
                graphics.PreferredBackBufferWidth = (int)(graphics.PreferredBackBufferWidth / 1.5);
            }

            //The name is insignificant, the player can't see it anyway.
            Player player = new Player("Starter", -1);
            player.moveX(350);

            timer = new System.Timers.Timer();

            timer.Interval = (85 * 100);
            timer.Enabled = true;

            timer.Elapsed += timer_Elapsed;

            DungeonManager.getInstance().setCurrentDungeon(new PresetDungeon(new StarterRoom()));
            InputManager.getInstance().setCurrentPlayer(player);
        }
 /// <summary>
 /// Sets the Current Player of the Game.
 /// </summary>
 /// <param name="player"></param>
 public void setCurrentPlayer(Player player)
 {
     this.currentPlayer = player;
 }