Exemplo n.º 1
0
 /// <summary>
 /// Constructs the gameState and passes Game and GameStateManager.
 /// </summary>
 /// <param name="game">game drawable component</param>
 /// <param name="manager">the stateManager</param>
 public GameState(Game game, GameStateManager manager)
     : base(game)
 {
     GameRef = (Game1)game;
         StateMananger = manager;
         stateRef = this;
 }
Exemplo n.º 2
0
        public Game1()
        {
            Content.RootDirectory = "Content";
            IsMouseVisible = true;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = width;
            graphics.PreferredBackBufferHeight = height;

            ScreenRectangle = new Rectangle(0, 0, width, height);

            Components.Add(new InputHandler(this));
            stateManager = new GameStateManager(this);

            TitleScreen = new TitleScreen(this, stateManager);
            BattleScreen = new BattleScreen(this, stateManager);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initlialise the game!
        /// </summary>
        public Game1()
        {
            Content.RootDirectory = "Content";
            IsMouseVisible = true;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = WIDTH;
            graphics.PreferredBackBufferHeight = HEIGHT;

            ScreenRectangle = new Rectangle(0, 0, WIDTH, HEIGHT);

            Components.Add(new Input(this));

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            // default starting screen
            TitleScreen = new TitleScreen(this, stateManager);
            BattleScreen = new BattleScreen(this, stateManager);

            stateManager.ChangeState(TitleScreen);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Constructs the TitleScreen and passes Game and GameStateManager
 /// </summary>
 /// <param name="game">the game class</param>
 /// <param name="manager">its assigned GameStateManager</param>
 public TitleScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs the BattleScreen and passes Game and GameStateManager
 /// </summary>
 /// <param name="game">the game class</param>
 /// <param name="manager">its assigned GameStateManager</param>
 public BattleScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     characters = new List<BattleCharacter>();
 }
Exemplo n.º 6
0
 /// <summary>
 /// pass game and stateManager reference
 /// </summary>
 public BattleScreen(Game1 game, GameStateManager man)
     : base(game, man)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// Set GameRef and StateManager
 /// </summary>
 /// <param name="game">Game1 reference</param>
 /// <param name="man">StateManager that this class belongs to</param>
 public GameState(Game1 game, GameStateManager man)
 {
     GameRef = game;
     StateManager = man;
 }