public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; screenRectangle = new Rectangle(0, 0, 1280, 720); graphics.PreferredBackBufferWidth = ScreenRectangle.Width; graphics.PreferredBackBufferHeight = ScreenRectangle.Height; gameStateManager = new GameStateManager(this); Components.Add(gameStateManager); this.IsMouseVisible = true; titleIntroState = new TitleIntroState(this); startMenuState = new MainMenuState(this); gamePlayState = new GamePlayState(this); conversationState = new ConversationState(this); battleState = new BattleState(this); gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One); characterManager = CharacterManager.Instance; }
public Game1() { graphics = new GraphicsDeviceManager(this) { SynchronizeWithVerticalRetrace = false, PreferredBackBufferWidth = 800, PreferredBackBufferHeight = 600 }; Content.RootDirectory = "Content"; screenRectangle = new Rectangle(0, 0, 1280, 720); graphics.PreferredBackBufferWidth = ScreenRectangle.Width; graphics.PreferredBackBufferHeight = ScreenRectangle.Height; _gameStateManager = new GameStateManager(this); Components.Add(_gameStateManager); IsMouseVisible = true; titleIntroState = new TitleIntroState(this); startMenuState = new MainMenuState(this); gamePlayState = new GameplayState(this); _gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One); }
public override void Update(GameTime gameTime) { menu.Update(gameTime); if (menu.MouseOver && Xin.CheckMouseReleased(MouseButton.Left)) { switch (menu.SelectedIndex) { case 0: IGamePlayState gamePlayState = (IGamePlayState)Game.Services.GetService( typeof(IGamePlayState)); gamePlayState.SetupNewGame(); manager.PushState((GameState)gamePlayState); break; case 1: break; case 2: manager.PushState(GameRef.OptionState); break; case 3: break; case 4: GameRef.Exit(); break; } } base.Update(gameTime); }
public GamePlay() { playState = new PlayState(this); stopedState = new StopedState(this); pausedState = new PausedState(this); gameState = stopedState; }
public Game1() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; ScreenRectangle = new Rectangle(0, 0, 1280, 720); _graphics.PreferredBackBufferHeight = ScreenRectangle.Height; _graphics.PreferredBackBufferWidth = ScreenRectangle.Width; GameStateManager = new GameStateManager(this); Components.Add(GameStateManager); IntroState = new TitleIntroState(this); StartMenuState = new MainMenuState(this); GamePlayState = new GamePlayState(this); GameStateManager.ChangeState(IntroState, PlayerIndex.One); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here title = this.Content.Load <Texture2D>("Graphics/OmegaZone-title"); font = this.Content.Load <SpriteFont>("Fonts/TitleFont"); this.ContentBank = new ContentBank(this.Content); this.ContentBank.LoadCombatContent(); gamePlayState = new GamePlayState(this); // for testing only!!! //GameOptions options = new GameOptions(); //options.GameType = GameType.SinglePlayer; //gamePlayState.SetUpNewGame(options); //gamePlayState.StartGame(); //gameStateManager.ChangeState((GamePlayState)gamePlayState, PlayerIndex.One); // TODO: remove later }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.SynchronizeWithVerticalRetrace = false; //vsync graphics.PreferredBackBufferFormat = SurfaceFormat.Alpha8; IsFixedTimeStep = false; if (IsFixedTimeStep) { TargetElapsedTime = TimeSpan.FromMilliseconds(1000.0f / 60); } SetWindowResolution(); IsMouseVisible = true; gameStateManager = new GameStateManager(this); Components.Add(gameStateManager); titleIntroState = new TitleIntroState(this); mainMenuState = new MainMenuState(this); gamePlayState = new GamePlayState(this); gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One); }
public void setState(IGamePlayState state) { gameState = state; }