public override void Update(GameTime gameTime) { // mouse state is given to mouse tictactoeMouse = Mouse.GetState(); // mouse collision algorithim mouseCollision.X = tictactoeMouse.X; mouseCollision.Y = tictactoeMouse.Y; // collision for mouse to change state if (buttonContinueRect.Intersects(mouseCollision)) { buttonIsHit = true; continuebutton = tictactoeButtonState.hit; if (ButtonState.Pressed == tictactoeMouse.LeftButton) { ScreenManager.Instance.AddScreen(new TicTacToeGameScreen()); } } if ((Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.Enter))) { ScreenManager.Instance.AddScreen(new TicTacToeGameScreen()); } if (!buttonContinueRect.Intersects(mouseCollision)) { buttonIsHit = true; continuebutton = tictactoeButtonState.free; } }
public TicTacToeTitleScreen() { volumeLevel = 1.0f; tictactoeMouse = new MouseState(); mouseCollision = new Rectangle(0, 0, 24, 24); buttonContinueRect = new Rectangle(750, 500, 256, 128); continuebutton = tictactoeButtonState.free; }