예제 #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;
 }
예제 #2
0
파일: Game1.cs 프로젝트: TristanZeph/XRDtS
        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);
        }
예제 #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);
        }
예제 #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)
 {
 }
예제 #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>();
 }
예제 #6
0
 /// <summary>
 /// pass game and stateManager reference
 /// </summary>
 public BattleScreen(Game1 game, GameStateManager man)
     : base(game, man)
 {
 }
예제 #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;
 }