From 7956f1807c8b7c4b992eccf3e39fdffb92c27ee3 Mon Sep 17 00:00:00 2001
From: Susan Yuen <susan_loves_cheese@hotmail.com>
Date: Mon, 14 Nov 2016 23:20:21 -0500
Subject: [PATCH] Fixed mouse coordinate offset when scrolling and formatted
 several classes

---
 src/Blaze-Brigade/Blaze_Brigade/Game.cs       | 314 +++++++++---------
 src/Blaze-Brigade/Blaze_Brigade/GameState.cs  |   8 +-
 src/Blaze-Brigade/Blaze_Brigade/Graph.cs      |   4 +-
 .../Blaze_Brigade/MouseHandler.cs             |  37 ++-
 4 files changed, 183 insertions(+), 180 deletions(-)

diff --git a/src/Blaze-Brigade/Blaze_Brigade/Game.cs b/src/Blaze-Brigade/Blaze_Brigade/Game.cs
index 8259d7a..66ec14e 100644
--- a/src/Blaze-Brigade/Blaze_Brigade/Game.cs
+++ b/src/Blaze-Brigade/Blaze_Brigade/Game.cs
@@ -242,9 +242,9 @@ namespace Controller
                         GameState.enemyPlayer = (tempPlayer);
                         GameFunction.startTurn(GameState.currentPlayer);
                     }
-                    
+
                     // removes deceased units in Player 1
-                    foreach(Unit unit in player1.getUnits())
+                    foreach (Unit unit in player1.getUnits())
                     {
                         if (!unit.Alive)
                         {
@@ -322,7 +322,7 @@ namespace Controller
                     if (GameState.playableUnitSelected)
                     {
                         Unit unit = GameState.selectedUnit;
-                        
+
                         if (!GameState.isAnimating)
                         {
                             #region Highlight nodes
@@ -339,7 +339,7 @@ namespace Controller
 
                                 foreach (Node attack in attackableNodes)
                                 {
-                                    if ((!GameState.moveableNodes.Contains(attack))&&(attack.unitOnNode!=unit)&&(!attack.isObstacle))
+                                    if ((!GameState.moveableNodes.Contains(attack)) && (attack.unitOnNode != unit) && (!attack.isObstacle))
                                     {
                                         spriteBatch.Draw(attackableNode, attack.getPosition(), null, Color.White * 0.2f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f);
                                     }
@@ -360,9 +360,9 @@ namespace Controller
                             if (GameState.dropDownMenuOpen) // if dropDowMenu should be opened, draw dropDownMenu
                             {
                                 unit.setButtonCoordinates(unit.PixelCoordinates);
-                                
+
                                 Button[] unitButtons = unit.getButtons();
-                                for(int i=0; i<4; i++)
+                                for (int i = 0; i < 4; i++)
                                 {
                                     if (unitButtons[i].Active)
                                     {
@@ -393,12 +393,12 @@ namespace Controller
 
                                 if (GameState.currentPlayer == player1)
                                 {
-                                    
+
                                     spriteBatch.Draw(unit.getCharAttackInfo(), Vector2.Zero, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.7f); //draw charAttackInfoBackground texture for current character
                                     spriteBatch.DrawString(largeFont, damageDealt.ToString(), new Vector2(180, 458), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws damage dealt
-                                    spriteBatch.DrawString(font, " x " +hitCount.ToString(), new Vector2(195, 459), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws hit count
-                                    spriteBatch.DrawString(largeFont, hitRate.ToString()+" %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws hit rate
-                                    spriteBatch.DrawString(largeFont, critRate.ToString()+" %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws crit rate
+                                    spriteBatch.DrawString(font, " x " + hitCount.ToString(), new Vector2(195, 459), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws hit count
+                                    spriteBatch.DrawString(largeFont, hitRate.ToString() + " %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws hit rate
+                                    spriteBatch.DrawString(largeFont, critRate.ToString() + " %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws crit rate
                                     spriteBatch.DrawString(largestFont, unit.Hp.ToString(), new Vector2(342, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit health
                                     spriteBatch.DrawString(largeFont, unit.equippedWeapon.name.ToString(), new Vector2(40, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon
 
@@ -419,9 +419,9 @@ namespace Controller
                                 {
                                     spriteBatch.Draw(attackedUnit.getCharAttackInfo(), Vector2.Zero, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.7f); //draw charAttackInfoBackground texture for current character
                                     spriteBatch.DrawString(largeFont, damageDealt.ToString(), new Vector2(180, 458), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack damage 
-                                    spriteBatch.DrawString(font, " x " +hitCount.ToString(), new Vector2(195, 459), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack hit count
-                                    spriteBatch.DrawString(largeFont, hitRate.ToString()+" %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack hit rate
-                                    spriteBatch.DrawString(largeFont, critRate.ToString()+" %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack crit rate
+                                    spriteBatch.DrawString(font, " x " + hitCount.ToString(), new Vector2(195, 459), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack hit count
+                                    spriteBatch.DrawString(largeFont, hitRate.ToString() + " %", new Vector2(170, 488), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack hit rate
+                                    spriteBatch.DrawString(largeFont, critRate.ToString() + " %", new Vector2(170, 518), Color.DarkBlue, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws counterattack crit rate
                                     spriteBatch.DrawString(largestFont, attackedUnit.Hp.ToString(), new Vector2(342, 475), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws enemy unit health
                                     spriteBatch.DrawString(largeFont, attackedUnit.equippedWeapon.name.ToString(), new Vector2(40, 348), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws unit's weapon
 
@@ -455,7 +455,7 @@ namespace Controller
                                     {
                                         if (unitButtons[i].hasItem) //if current menu button actually has an item stored in it
                                         {
-                                            spriteBatch.DrawString(font, unitButtons[i].weapon.name.ToString(), unitButtons[i].getPixelCoordinates()+(new Vector2(15,5)), Color.Black, 0, 
+                                            spriteBatch.DrawString(font, unitButtons[i].weapon.name.ToString(), unitButtons[i].getPixelCoordinates() + (new Vector2(15, 5)), Color.Black, 0,
                                                 Vector2.Zero, 1f, SpriteEffects.None, 0f); //draws item stored in unitButtons[i]
                                             spriteBatch.Draw(unitButtons[i].getImage(), unitButtons[i].getPixelCoordinates(), null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.1f);
                                         }
@@ -467,7 +467,7 @@ namespace Controller
                         #region Character Info Screen player1
 
                         //if player 1, prints info screen for player 1
-                        if ((GameState.currentPlayer == player1)&&(!GameState.attackConfirmOpen))
+                        if ((GameState.currentPlayer == player1) && (!GameState.attackConfirmOpen))
                         {
                             Vector2 statLocation = new Vector2(170, 535); //starting location for first stat
                             Vector2 statLocation2 = new Vector2(235, 535); //starting location for first stat
@@ -477,12 +477,12 @@ namespace Controller
 
                             for (int k = 0; k < 4; k++) //for stats - level, str, int, skill,
                             {
-                                spriteBatch.DrawString(font, stats[k].ToString(), statLocation, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); 
+                                spriteBatch.DrawString(font, stats[k].ToString(), statLocation, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f);
                                 statLocation = statLocation + increment; //increment downwards
                             }
                             for (int t = 4; t < 7; t++) //for stats - speed, defense, resistance 
                             {
-                                spriteBatch.DrawString(font, stats[t].ToString(), statLocation2, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); 
+                                spriteBatch.DrawString(font, stats[t].ToString(), statLocation2, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f);
                                 statLocation2 = statLocation2 + increment; //increment downwards
                             }
 
@@ -494,20 +494,20 @@ namespace Controller
                         {
                             if (!GameState.attackConfirmOpen)
                             {
-                            Vector2 statLocation = new Vector2(795, 533); //starting location for first stat
-                            Vector2 statLocation2 = new Vector2(860, 533); //starting location for first stat
-                            Vector2 increment = new Vector2(0, 20); //increment downwards for each stat
-                            Vector2 infoLocation = new Vector2(635, 513);
-                            int[] stats = unit.getStats();
+                                Vector2 statLocation = new Vector2(795, 533); //starting location for first stat
+                                Vector2 statLocation2 = new Vector2(860, 533); //starting location for first stat
+                                Vector2 increment = new Vector2(0, 20); //increment downwards for each stat
+                                Vector2 infoLocation = new Vector2(635, 513);
+                                int[] stats = unit.getStats();
 
                                 for (int k = 0; k < 4; k++) //for stats - level, str, int, skill,
                                 {
-                                    spriteBatch.DrawString(font, stats[k].ToString(), statLocation, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); 
+                                    spriteBatch.DrawString(font, stats[k].ToString(), statLocation, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f);
                                     statLocation = statLocation + increment; //increment downwards
                                 }
                                 for (int t = 4; t < 7; t++) //for stats - speed, defense, resistance 
                                 {
-                                    spriteBatch.DrawString(font, stats[t].ToString(), statLocation2, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); 
+                                    spriteBatch.DrawString(font, stats[t].ToString(), statLocation2, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f);
                                     statLocation2 = statLocation2 + increment; //increment downwards
                                 }
 
@@ -524,7 +524,7 @@ namespace Controller
                     if (GameState.gameOver)
                     {
                         Vector2 gameOverLocation = new Vector2(-370, -300);
-                        spriteBatch.DrawString(largestFont,"Game Over", new Vector2(350, 200), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0f); //draws Game Over Text
+                        spriteBatch.DrawString(largestFont, "Game Over", new Vector2(350, 200), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0f); //draws Game Over Text
                         spriteBatch.Draw(gameOver, Vector2.Zero, null, Color.White, 0, gameOverLocation, 1f, SpriteEffects.None, 0f);
                         spriteBatch.Draw(backGround, Vector2.Zero, null, Color.Black * 0.5f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f);
 
@@ -536,7 +536,7 @@ namespace Controller
                             if (unit.Alive)
                             {
                                 spriteBatch.Draw(unit.getSpriteImage(), unit.PixelCoordinates,
-                                    unit.getCurrentFrame(), Color.Black*0.5f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.8f);
+                                    unit.getCurrentFrame(), Color.Black * 0.5f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.8f);
                             }
                         }
                         #endregion
@@ -549,7 +549,7 @@ namespace Controller
                             if (unit.Alive)
                             {
                                 spriteBatch.Draw(unit.getSpriteImage(), unit.PixelCoordinates,
-                                    unit.getCurrentFrame(), Color.Black*0.5f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.8f);
+                                    unit.getCurrentFrame(), Color.Black * 0.5f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.8f);
                             }
                         }
                         #endregion
@@ -563,7 +563,7 @@ namespace Controller
 
                     spriteBatch.Draw(backGround, Vector2.Zero, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 1);
 
-                    
+
 
                     break;
             }
@@ -574,7 +574,7 @@ namespace Controller
 
         private static bool findAttackType(Unit unit1)
         {
-            if ((unit1.getClass() == UnitType.Warrior)|| (unit1.getClass() == UnitType.Archer))
+            if ((unit1.getClass() == UnitType.Warrior) || (unit1.getClass() == UnitType.Archer))
             {
                 return false;
             }
@@ -603,7 +603,7 @@ namespace Controller
             {
                 if (unitType == UnitType.Warrior)
                 {
-                    Unit unit = new Warrior(Content.Load<Texture2D>("warrior"),unitButtons, Content.Load<Texture2D>("warrior_stats"), Content.Load<Texture2D>("warrior_attack"), unitPosition);
+                    Unit unit = new Warrior(Content.Load<Texture2D>("warrior"), unitButtons, Content.Load<Texture2D>("warrior_stats"), Content.Load<Texture2D>("warrior_attack"), unitPosition);
                     Weapon startingWeap = new BronzeSword();
                     Weapon startingWeap2 = new IronSword();
                     unit.equippedWeapon = startingWeap;
@@ -615,7 +615,7 @@ namespace Controller
 
                 if (unitType == UnitType.Mage)
                 {
-                    Unit unit = new Mage(Content.Load<Texture2D>("mage"),unitButtons, Content.Load<Texture2D>("mage_stats"), Content.Load<Texture2D>("mage_attack"), unitPosition);
+                    Unit unit = new Mage(Content.Load<Texture2D>("mage"), unitButtons, Content.Load<Texture2D>("mage_stats"), Content.Load<Texture2D>("mage_attack"), unitPosition);
                     Weapon startingWeap = new Fireball();
                     Weapon startingWeap2 = new Fireblast();
                     unit.equippedWeapon = startingWeap;
@@ -667,7 +667,7 @@ namespace Controller
 
                 if (unitType == UnitType.Archer)
                 {
-                    Unit unit = new Archer(Content.Load<Texture2D>("2archer"),unitButtons, Content.Load<Texture2D>("2archer_stats"), Content.Load<Texture2D>("2archer_attack"), unitPosition);
+                    Unit unit = new Archer(Content.Load<Texture2D>("2archer"), unitButtons, Content.Load<Texture2D>("2archer_stats"), Content.Load<Texture2D>("2archer_attack"), unitPosition);
                     Weapon startingWeap = new ShortBow();
                     Weapon startingWeap2 = new LongBow();
                     unit.equippedWeapon = startingWeap;
@@ -686,156 +686,156 @@ namespace Controller
         {
             for (int y = 5; y <= 14; y++)
             {
-                graph.getNode(2, y).isObstacle=(true);
+                graph.getNode(2, y).isObstacle = (true);
             }
-            graph.getNode(3, 5).isObstacle=(true);
-            graph.getNode(3, 13).isObstacle=(true);
-            graph.getNode(4, 3).isObstacle=(true);
-            graph.getNode(4, 4).isObstacle=(true);
-            graph.getNode(4, 13).isObstacle=(true);
-            graph.getNode(4, 14).isObstacle=(true);
-            graph.getNode(5, 2).isObstacle=(true);
-            graph.getNode(5, 15).isObstacle=(true);
-            graph.getNode(6, 2).isObstacle=(true);
-            graph.getNode(6, 14).isObstacle=(true);
-            graph.getNode(7, 2).isObstacle=(true);
-            graph.getNode(7, 3).isObstacle=(true);
-            graph.getNode(7, 4).isObstacle=(true);
-            graph.getNode(7, 14).isObstacle=(true);
-            graph.getNode(8, 4).isObstacle=(true);
+            graph.getNode(3, 5).isObstacle = (true);
+            graph.getNode(3, 13).isObstacle = (true);
+            graph.getNode(4, 3).isObstacle = (true);
+            graph.getNode(4, 4).isObstacle = (true);
+            graph.getNode(4, 13).isObstacle = (true);
+            graph.getNode(4, 14).isObstacle = (true);
+            graph.getNode(5, 2).isObstacle = (true);
+            graph.getNode(5, 15).isObstacle = (true);
+            graph.getNode(6, 2).isObstacle = (true);
+            graph.getNode(6, 14).isObstacle = (true);
+            graph.getNode(7, 2).isObstacle = (true);
+            graph.getNode(7, 3).isObstacle = (true);
+            graph.getNode(7, 4).isObstacle = (true);
+            graph.getNode(7, 14).isObstacle = (true);
+            graph.getNode(8, 4).isObstacle = (true);
             for (int y = 14; y <= 17; y++)
             {
-                graph.getNode(8, y).isObstacle=(true);
+                graph.getNode(8, y).isObstacle = (true);
             }
-            graph.getNode(9, 4).isObstacle=(true);
+            graph.getNode(9, 4).isObstacle = (true);
             for (int y = 17; y <= 20; y++)
             {
-                graph.getNode(9, y).isObstacle=(true);
+                graph.getNode(9, y).isObstacle = (true);
             }
-            graph.getNode(10, 4).isObstacle=(true);
-            graph.getNode(10, 20).isObstacle=(true);
-            graph.getNode(10, 21).isObstacle=(true);
-            graph.getNode(10, 22).isObstacle=(true);
-            graph.getNode(11, 4).isObstacle=(true);
-            graph.getNode(11, 14).isObstacle=(true);
-            graph.getNode(11, 22).isObstacle=(true);
-            graph.getNode(12, 3).isObstacle=(true);
+            graph.getNode(10, 4).isObstacle = (true);
+            graph.getNode(10, 20).isObstacle = (true);
+            graph.getNode(10, 21).isObstacle = (true);
+            graph.getNode(10, 22).isObstacle = (true);
+            graph.getNode(11, 4).isObstacle = (true);
+            graph.getNode(11, 14).isObstacle = (true);
+            graph.getNode(11, 22).isObstacle = (true);
+            graph.getNode(12, 3).isObstacle = (true);
             for (int y = 22; y <= 25; y++)
             {
-                graph.getNode(12, y).isObstacle=(true);
+                graph.getNode(12, y).isObstacle = (true);
             }
-            graph.getNode(13, 4).isObstacle=(true);
-            graph.getNode(12, 25).isObstacle=(true);
-            graph.getNode(14, 4).isObstacle=(true);
-            graph.getNode(14, 25).isObstacle=(true);
-            graph.getNode(15, 4).isObstacle=(true);
-            graph.getNode(15, 25).isObstacle=(true);
-            graph.getNode(15, 26).isObstacle=(true);
-            graph.getNode(15, 27).isObstacle=(true);
-            graph.getNode(16, 3).isObstacle=(true);
-            graph.getNode(16, 27).isObstacle=(true);
-            graph.getNode(17, 2).isObstacle=(true);
-            graph.getNode(17, 3).isObstacle=(true);
-            graph.getNode(17, 27).isObstacle=(true);
-            graph.getNode(18, 1).isObstacle=(true);
-            graph.getNode(18, 27).isObstacle=(true);
-            graph.getNode(19, 1).isObstacle=(true);
-            graph.getNode(19, 27).isObstacle=(true);
-            graph.getNode(20, 2).isObstacle=(true);
+            graph.getNode(13, 4).isObstacle = (true);
+            graph.getNode(12, 25).isObstacle = (true);
+            graph.getNode(14, 4).isObstacle = (true);
+            graph.getNode(14, 25).isObstacle = (true);
+            graph.getNode(15, 4).isObstacle = (true);
+            graph.getNode(15, 25).isObstacle = (true);
+            graph.getNode(15, 26).isObstacle = (true);
+            graph.getNode(15, 27).isObstacle = (true);
+            graph.getNode(16, 3).isObstacle = (true);
+            graph.getNode(16, 27).isObstacle = (true);
+            graph.getNode(17, 2).isObstacle = (true);
+            graph.getNode(17, 3).isObstacle = (true);
+            graph.getNode(17, 27).isObstacle = (true);
+            graph.getNode(18, 1).isObstacle = (true);
+            graph.getNode(18, 27).isObstacle = (true);
+            graph.getNode(19, 1).isObstacle = (true);
+            graph.getNode(19, 27).isObstacle = (true);
+            graph.getNode(20, 2).isObstacle = (true);
             for (int y = 24; y <= 27; y++)
             {
-                graph.getNode(20, y).isObstacle=(true);
+                graph.getNode(20, y).isObstacle = (true);
             }
-            graph.getNode(21, 2).isObstacle=(true);
-            graph.getNode(21, 21).isObstacle=(true);
-            graph.getNode(21, 22).isObstacle=(true);
-            graph.getNode(21, 23).isObstacle=(true);
-            graph.getNode(22, 1).isObstacle=(true);
-            graph.getNode(22, 2).isObstacle=(true);
-            graph.getNode(22, 20).isObstacle=(true);
-            graph.getNode(23, 0).isObstacle=(true);
-            graph.getNode(23, 20).isObstacle=(true);
-            graph.getNode(24, 0).isObstacle=(true);
-            graph.getNode(24, 20).isObstacle=(true);
-            graph.getNode(25, 1).isObstacle=(true);
-            graph.getNode(25, 20).isObstacle=(true);
-            graph.getNode(26, 1).isObstacle=(true);
-            graph.getNode(26, 21).isObstacle=(true);
-            graph.getNode(27, 1).isObstacle=(true);
-            graph.getNode(27, 22).isObstacle=(true);
-            graph.getNode(28, 0).isObstacle=(true);
+            graph.getNode(21, 2).isObstacle = (true);
+            graph.getNode(21, 21).isObstacle = (true);
+            graph.getNode(21, 22).isObstacle = (true);
+            graph.getNode(21, 23).isObstacle = (true);
+            graph.getNode(22, 1).isObstacle = (true);
+            graph.getNode(22, 2).isObstacle = (true);
+            graph.getNode(22, 20).isObstacle = (true);
+            graph.getNode(23, 0).isObstacle = (true);
+            graph.getNode(23, 20).isObstacle = (true);
+            graph.getNode(24, 0).isObstacle = (true);
+            graph.getNode(24, 20).isObstacle = (true);
+            graph.getNode(25, 1).isObstacle = (true);
+            graph.getNode(25, 20).isObstacle = (true);
+            graph.getNode(26, 1).isObstacle = (true);
+            graph.getNode(26, 21).isObstacle = (true);
+            graph.getNode(27, 1).isObstacle = (true);
+            graph.getNode(27, 22).isObstacle = (true);
+            graph.getNode(28, 0).isObstacle = (true);
             for (int y = 22; y <= 27; y++)
             {
-                graph.getNode(28, y).isObstacle=(true);
+                graph.getNode(28, y).isObstacle = (true);
             }
-            graph.getNode(29, 1).isObstacle=(true);
-            graph.getNode(29, 2).isObstacle=(true);
-            graph.getNode(29, 3).isObstacle=(true);
-            graph.getNode(29, 27).isObstacle=(true);
-            graph.getNode(30, 3).isObstacle=(true);
-            graph.getNode(30, 27).isObstacle=(true);
-            graph.getNode(31, 2).isObstacle=(true);
-            graph.getNode(31, 3).isObstacle=(true);
-            graph.getNode(31, 27).isObstacle=(true);
-            graph.getNode(32, 27).isObstacle=(true);
-            graph.getNode(33, 2).isObstacle=(true);
-            graph.getNode(33, 3).isObstacle=(true);
-            graph.getNode(33, 26).isObstacle=(true);
-            graph.getNode(34, 3).isObstacle=(true);
-            graph.getNode(34, 25).isObstacle=(true);
-            graph.getNode(35, 3).isObstacle=(true);
-            graph.getNode(35, 25).isObstacle=(true);
-            graph.getNode(36, 2).isObstacle=(true);
-            graph.getNode(36, 25).isObstacle=(true);
-            graph.getNode(37, 2).isObstacle=(true);
-            graph.getNode(37, 25).isObstacle=(true);
-            graph.getNode(38, 2).isObstacle=(true);
+            graph.getNode(29, 1).isObstacle = (true);
+            graph.getNode(29, 2).isObstacle = (true);
+            graph.getNode(29, 3).isObstacle = (true);
+            graph.getNode(29, 27).isObstacle = (true);
+            graph.getNode(30, 3).isObstacle = (true);
+            graph.getNode(30, 27).isObstacle = (true);
+            graph.getNode(31, 2).isObstacle = (true);
+            graph.getNode(31, 3).isObstacle = (true);
+            graph.getNode(31, 27).isObstacle = (true);
+            graph.getNode(32, 27).isObstacle = (true);
+            graph.getNode(33, 2).isObstacle = (true);
+            graph.getNode(33, 3).isObstacle = (true);
+            graph.getNode(33, 26).isObstacle = (true);
+            graph.getNode(34, 3).isObstacle = (true);
+            graph.getNode(34, 25).isObstacle = (true);
+            graph.getNode(35, 3).isObstacle = (true);
+            graph.getNode(35, 25).isObstacle = (true);
+            graph.getNode(36, 2).isObstacle = (true);
+            graph.getNode(36, 25).isObstacle = (true);
+            graph.getNode(37, 2).isObstacle = (true);
+            graph.getNode(37, 25).isObstacle = (true);
+            graph.getNode(38, 2).isObstacle = (true);
             for (int y = 9; y <= 14; y++)
             {
-                graph.getNode(38, y).isObstacle=(true);
+                graph.getNode(38, y).isObstacle = (true);
             }
-            graph.getNode(38, 26).isObstacle=(true);
-            graph.getNode(39, 2).isObstacle=(true);
-            graph.getNode(39, 8).isObstacle=(true);
-            graph.getNode(39, 14).isObstacle=(true);
-            graph.getNode(40, 3).isObstacle=(true);
-            graph.getNode(40, 7).isObstacle=(true);
-            graph.getNode(40, 14).isObstacle=(true);
-            graph.getNode(40, 26).isObstacle=(true);
-            graph.getNode(41, 3).isObstacle=(true);
-            graph.getNode(41, 7).isObstacle=(true);
+            graph.getNode(38, 26).isObstacle = (true);
+            graph.getNode(39, 2).isObstacle = (true);
+            graph.getNode(39, 8).isObstacle = (true);
+            graph.getNode(39, 14).isObstacle = (true);
+            graph.getNode(40, 3).isObstacle = (true);
+            graph.getNode(40, 7).isObstacle = (true);
+            graph.getNode(40, 14).isObstacle = (true);
+            graph.getNode(40, 26).isObstacle = (true);
+            graph.getNode(41, 3).isObstacle = (true);
+            graph.getNode(41, 7).isObstacle = (true);
             for (int y = 14; y <= 17; y++)
             {
-                graph.getNode(41, y).isObstacle=(true);
+                graph.getNode(41, y).isObstacle = (true);
             }
-            graph.getNode(41, 27).isObstacle=(true);
-            graph.getNode(42, 4).isObstacle=(true);
-            graph.getNode(42, 7).isObstacle=(true);
-            graph.getNode(42, 17).isObstacle=(true);
-            graph.getNode(42, 27).isObstacle=(true);
-            graph.getNode(43, 4).isObstacle=(true);
-            graph.getNode(43, 7).isObstacle=(true);
-            graph.getNode(43, 17).isObstacle=(true);
-            graph.getNode(43, 27).isObstacle=(true);
-            graph.getNode(44, 4).isObstacle=(true);
-            graph.getNode(44, 7).isObstacle=(true);
+            graph.getNode(41, 27).isObstacle = (true);
+            graph.getNode(42, 4).isObstacle = (true);
+            graph.getNode(42, 7).isObstacle = (true);
+            graph.getNode(42, 17).isObstacle = (true);
+            graph.getNode(42, 27).isObstacle = (true);
+            graph.getNode(43, 4).isObstacle = (true);
+            graph.getNode(43, 7).isObstacle = (true);
+            graph.getNode(43, 17).isObstacle = (true);
+            graph.getNode(43, 27).isObstacle = (true);
+            graph.getNode(44, 4).isObstacle = (true);
+            graph.getNode(44, 7).isObstacle = (true);
             for (int y = 17; y <= 23; y++)
             {
-                graph.getNode(44, y).isObstacle=(true);
+                graph.getNode(44, y).isObstacle = (true);
             }
-            graph.getNode(44, 27).isObstacle=(true);
-            graph.getNode(45, 4).isObstacle=(true);
-            graph.getNode(45, 5).isObstacle=(true);
-            graph.getNode(45, 24).isObstacle=(true);
-            graph.getNode(45, 25).isObstacle=(true);
-            graph.getNode(45, 27).isObstacle=(true);
-            graph.getNode(46, 5).isObstacle=(true);
-            graph.getNode(46, 7).isObstacle=(true);
-            graph.getNode(46, 25).isObstacle=(true);
-            graph.getNode(46, 26).isObstacle=(true);
-            graph.getNode(47, 5).isObstacle=(true);
-            graph.getNode(47, 6).isObstacle=(true);
-            graph.getNode(47, 7).isObstacle=(true);
+            graph.getNode(44, 27).isObstacle = (true);
+            graph.getNode(45, 4).isObstacle = (true);
+            graph.getNode(45, 5).isObstacle = (true);
+            graph.getNode(45, 24).isObstacle = (true);
+            graph.getNode(45, 25).isObstacle = (true);
+            graph.getNode(45, 27).isObstacle = (true);
+            graph.getNode(46, 5).isObstacle = (true);
+            graph.getNode(46, 7).isObstacle = (true);
+            graph.getNode(46, 25).isObstacle = (true);
+            graph.getNode(46, 26).isObstacle = (true);
+            graph.getNode(47, 5).isObstacle = (true);
+            graph.getNode(47, 6).isObstacle = (true);
+            graph.getNode(47, 7).isObstacle = (true);
         }
     }
 }
\ No newline at end of file
diff --git a/src/Blaze-Brigade/Blaze_Brigade/GameState.cs b/src/Blaze-Brigade/Blaze_Brigade/GameState.cs
index 068a9de..b7bf64e 100644
--- a/src/Blaze-Brigade/Blaze_Brigade/GameState.cs
+++ b/src/Blaze-Brigade/Blaze_Brigade/GameState.cs
@@ -52,11 +52,11 @@ namespace Model
         /**
         Sets and gets if a unit has moved yet or not. beforeMOve is true before unit moves, false after it moves. Used to determine what tiles are highlighted
         */
-        public static bool beforeMove { get; set; } 
+        public static bool beforeMove { get; set; }
         /*
         Sets and gets whether an animation sequence is currently on screen
         */
-        public static bool isAnimating { get; set; } 
+        public static bool isAnimating { get; set; }
         /*
         Sets and gets whether game is over
         */
@@ -72,7 +72,7 @@ namespace Model
         /*
         Sets and gets movable nodes that can be retrieved without calling path finding
         */
-        public static LinkedList<Node> moveableNodes { get; set; }  
+        public static LinkedList<Node> moveableNodes { get; set; }
     }
     /*
     enumerated list for different possible Game States
@@ -93,7 +93,7 @@ namespace Model
     enumerated list for what the current turn state is (per unit)
     */
     enum TurnState
-    { 
+    {
         Wait,
         AttackMenu,
         Attack,
diff --git a/src/Blaze-Brigade/Blaze_Brigade/Graph.cs b/src/Blaze-Brigade/Blaze_Brigade/Graph.cs
index 764f4cd..1e9ea69 100644
--- a/src/Blaze-Brigade/Blaze_Brigade/Graph.cs
+++ b/src/Blaze-Brigade/Blaze_Brigade/Graph.cs
@@ -69,8 +69,8 @@ namespace Model
        */
         public Node getNode(Vector2 pixelCoordinates)
         {
-            int x = (int) Math.Floor(pixelCoordinates.X / 32);
-            int y = (int) Math.Floor(pixelCoordinates.Y / 32);
+            int x = (int)Math.Floor(pixelCoordinates.X / 32);
+            int y = (int)Math.Floor(pixelCoordinates.Y / 32);
             return nodes[x, y];
         }
 
diff --git a/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs b/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs
index 0431db5..4d714ec 100644
--- a/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs
+++ b/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs
@@ -83,18 +83,19 @@ namespace Controller
                 GameState.unitToAttack = null;
                 GameState.attackConfirmOpen = false;
                 GameState.dropDownMenuOpen = false;
-            }else if(lastMouseState.RightButton == ButtonState.Released
-                && currentMouseState.RightButton == ButtonState.Pressed
-                && validX && validY)
+            }
+            else if (lastMouseState.RightButton == ButtonState.Released
+               && currentMouseState.RightButton == ButtonState.Pressed
+               && validX && validY)
             {
                 GameState.endTurnButton = true;
                 GameState.endTurnButtonLocation = new Vector2(currentMouseState.X, currentMouseState.Y);
             }
 
-                // checks for single mouse left click inside the game window
-                if (lastMouseState.LeftButton == ButtonState.Released
-                && currentMouseState.LeftButton == ButtonState.Pressed
-                && validX && validY)
+            // checks for single mouse left click inside the game window
+            if (lastMouseState.LeftButton == ButtonState.Released
+            && currentMouseState.LeftButton == ButtonState.Pressed
+            && validX && validY)
             {
                 // do not react to mouse input if animation is on screen
                 if (GameState.isAnimating)
@@ -102,31 +103,33 @@ namespace Controller
                     return;
                 }
 
-                Vector2 mouseClickCoordinates = new Vector2(currentMouseState.X, currentMouseState.Y);   // mouse click coordinates
+                // Note: currentMouseState is the pixel coordinates relative to screen; need to get it relative to map, so need offset based on camera position
+                Vector2 mouseClickCoordinates = new Vector2(currentMouseState.X - camera.Position.X, currentMouseState.Y - camera.Position.Y);
                 Node nodeClickedOn = graph.getNode(mouseClickCoordinates);
 
                 //if end turn is clicked
                 if (GameState.endTurnButton)
                 {
-                    if(mouseClickCoordinates.X>GameState.endTurnButtonLocation.X && mouseClickCoordinates.X < GameState.endTurnButtonLocation.X + 128 
-                        && mouseClickCoordinates.Y>GameState.endTurnButtonLocation.Y && mouseClickCoordinates.Y<GameState.endTurnButtonLocation.Y+32)
+                    if (mouseClickCoordinates.X > GameState.endTurnButtonLocation.X && mouseClickCoordinates.X < GameState.endTurnButtonLocation.X + 128
+                        && mouseClickCoordinates.Y > GameState.endTurnButtonLocation.Y && mouseClickCoordinates.Y < GameState.endTurnButtonLocation.Y + 32)
                     {
                         Player tempPlayer = GameState.currentPlayer;
                         GameState.currentPlayer = (GameState.enemyPlayer);
                         GameState.enemyPlayer = (tempPlayer);
                         GameFunction.startTurn(GameState.currentPlayer);
                         GameState.endTurnButton = false;
-                    }else
+                    }
+                    else
                     {
                         GameState.endTurnButton = false;
                     }
                 }
-
-
-
+                
                 if (GameState.gameOver)
                 {
-                    if ((mouseClickCoordinates.X > 370 & mouseClickCoordinates.X < 556) & (mouseClickCoordinates.Y>300&mouseClickCoordinates.Y<396)){
+                    if (mouseClickCoordinates.X > 370 && mouseClickCoordinates.X < 556 &&
+                        mouseClickCoordinates.Y > 300 && mouseClickCoordinates.Y < 396)
+                    {
                         GameState.exitGameClicked = true;
                     }
                 }
@@ -406,7 +409,7 @@ namespace Controller
 
             int ButtonX = (int)unit.getButtonType(ButtonType.AttackConfirm).getPixelCoordinates().X;
             int ButtonY = (int)unit.getButtonType(ButtonType.AttackConfirm).getPixelCoordinates().Y;
-            if (ButtonX+90 <= clickX && clickX < ButtonX + 214 && ButtonY+127 <= clickY && clickY < ButtonY + 172)
+            if (ButtonX + 90 <= clickX && clickX < ButtonX + 214 && ButtonY + 127 <= clickY && clickY < ButtonY + 172)
             {
                 if (GameState.attackConfirmOpen)
                 {
@@ -488,7 +491,7 @@ namespace Controller
                     }
                     #endregion
                     attackAnimation(attackDir, unit);
-                    
+
                     bool attackType = false;
 
                     //find what attack type unit is making
-- 
GitLab