# HG changeset patch # User Alys Brooks # Date 2021-06-07 02:31:03 # Node ID 618ba5e5eb0e49554936958d407dafc87fb8de72 # Parent b024346e385e4660c458a1fe9412abd2e66409b4 Fix right click to jump. Apparently I had it right the whole time, it's just that it would get triggered many times because I wasn't checking that the mouse was previously released. diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -30,6 +30,7 @@ class FNAGame : Game { private KeyboardState keyboardPrev = new KeyboardState(); + private MouseState mousePrev = new MouseState(); private SpriteBatch batch; private SoundEffect sound; @@ -448,10 +449,8 @@ #if DEBUG - if (mouseCur.RightButton == ButtonState.Pressed) + if (mouseCur.RightButton == ButtonState.Pressed && mousePrev.RightButton == ButtonState.Released) { - Vector2 cameraMiddle = this.camera.position + new Vector2(FNAGame.width / 2, FNAGame.height / 2); - Vector2 delta = this.camera.position - this.original_point; this.camera.Jump(this.original_point); } #endif @@ -495,6 +494,7 @@ } this.keyboardPrev = keyboardCur; + this.mousePrev = mouseCur; stopWatch.Stop(); this.updateTime = stopWatch.Elapsed;