Ejemplo n.º 1
0
 public IntroState(GameStateManager stateManager, Game game)
 {
     this.game = game;
     this.stateManager = stateManager;
     stringFormat.Alignment = StringAlignment.Center;
     stringFormat.LineAlignment = StringAlignment.Center;
 }
Ejemplo n.º 2
0
 public MainState(GameStateManager stateManager, Game game, LevelManager levelManager)
 {
     this.stateManager = stateManager;
     this.game = game;
     this.levelManager = levelManager;
     currentLevel = levelManager.GetLevel(0);
 }
Ejemplo n.º 3
0
 public LevelWonState(GameStateManager stateManager, Game game, LevelManager levelManager)
 {
     this.game = game;
     this.stateManager = stateManager;
     this.levelManager = levelManager;
     stringFormat.Alignment = StringAlignment.Center;
     stringFormat.LineAlignment = StringAlignment.Center;
 }
Ejemplo n.º 4
0
        public MenuState(GameStateManager stateManager, Game game, LevelManager levelManager)
        {
            this.game = game;
            this.stateManager = stateManager;
            this.levelManager = levelManager;
            stringFormat.Alignment = StringAlignment.Center;
            stringFormat.LineAlignment = StringAlignment.Center;

            menuForm = new Form();
            menuForm.Size = new Size(300, 300);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Starts the game running </summary>
 /// <param name="gameStateManager">
 /// A GameStateManager with at lease one IGameState added. </param>
 /// <remarks>
 /// Overriders of this method should start the game loop after the game
 /// is up and running. </remarks>
 public virtual void Run(GameStateManager gameStateManager)
 {
     gameLoop = new GameLoop(this, gameStateManager);
 }
Ejemplo n.º 6
0
 internal GameLoop(Game game, GameStateManager stateManager)
 {
     this.game = game;
     this.stateManager = stateManager;
 }
Ejemplo n.º 7
0
        /// <see cref="Game"/>
        public override void Run(GameStateManager gameStateManager)
        {
            base.Run(gameStateManager);

            //
            // Application.Run() is a blocking method.  We need to hook into it's
            // Shown event to start the GameLoop AFTER it is up and running.
            //

            form.Shown += new EventHandler(OnFormShown);
            form.FormClosed += new FormClosedEventHandler(OnFormClosed);
            Application.Run(form);
        }