コード例 #1
0
 public GameState(Game game, GameStateManager manager)
     : base(game)
 {
     this.stateManager = manager;
     this.childComponents = new List<GameComponent>();
     this.tag = this;
 }
コード例 #2
0
        public Game1()
        {
            this.InitializeGraphics();

            this.screenRectangle = new Rectangle(0, 0, ScreenWidth, ScreenHeight);
            this.Content.RootDirectory = "Content";

            this.Components.Add(new InputHandler(this));

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

            this.TitleScreen = new TitleScreen(this, this.stateManager);
            this.StartMenuScreen = new StartMenuScreen(this, this.stateManager);
            this.GamePlayScreen = new GamePlayScreen(this, this.stateManager);
            this.CreditsScreen = new CreditsScreen(this, this.stateManager);

            this.stateManager.ChangeState(this.TitleScreen);
        }
コード例 #3
0
 public BaseGameState(Game game, GameStateManager manager)
     : base(game, manager)
 {
     // Creates a reference to the main game.
     this.gameRef = (Game1)game;
 }
コード例 #4
0
        private float maxLabelWidth = 0f; // Controls where the arrow appears in the menu.
        #endregion

        public StartMenuScreen(Game game, GameStateManager manager) : base(game, manager)
        {
        }
コード例 #5
0
 public CreditsScreen(Game game, GameStateManager manager) : base(game, manager)
 {
 }
コード例 #6
0
 public TitleScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
 }
コード例 #7
0
 public GamePlayScreen(Game game, GameStateManager manager) : base(game, manager)
 {
     this.player = new Player(game);
 }