protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { this.Exit(); } Touches = TouchPanel.GetState(); simulator.BeginWrite(); simulator.SetSourcePosition(-Vector2.One * 2); if (Touches.Count > 0) { HandleInput(Mode); } //add rain //simulator.Write(Pixel, new Rectangle(random.Next(0, simulator.Width), random.Next(0, simulator.Height), 1, 1), new Color(1, 0, 0, 1), WriteMode.Height); simulator.EndWrite(); simulator.Simulate(1f / 120, 4); base.Update(gameTime); }
protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { this.Exit(); } mouse.Update(); keyboard.Update(); HandleInput(keyboard.Key(Keys.LeftShift) ? WriteMode.Tone : WriteMode.Wall); if (!keyboard.Key(Keys.P)) { simulator.Simulate(1f / 30, keyboard.Key(Keys.O) ? 1 : 60); } base.Update(gameTime); }