]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/Human.cs
SaberMonster loads from map file and walks around using the path finder, and a lot...
[chaz/carfire] / CarFire / CarFire / CarFire / Human.cs
index 519d9d02f14908767e150112472c01d7638d6bd1..08d962a1e682042ef420fab99b59b8fb52815d78 100644 (file)
@@ -22,7 +22,7 @@ namespace CarFire
         const int shootCoolDown = 10;\r
         State state;\r
         String CharName;\r
         const int shootCoolDown = 10;\r
         State state;\r
         String CharName;\r
-        Map theMap;\r
+        Game game;\r
         Texture2D charModel;\r
         Texture2D projectileModel;\r
         int health;\r
         Texture2D charModel;\r
         Texture2D projectileModel;\r
         int health;\r
@@ -40,9 +40,9 @@ namespace CarFire
         int projectileCoolDown;\r
         \r
 \r
         int projectileCoolDown;\r
         \r
 \r
-        public Human(Map _theMap, String Name, Texture2D model, Texture2D projectile, Display mDisplay, Point position)\r
+        public Human(Game theGame, String Name, Texture2D model, Texture2D projectile, Display mDisplay, Point position)\r
         {\r
         {\r
-            theMap = _theMap;\r
+            game = theGame;\r
             CharName = Name;\r
             theDisplay = mDisplay;\r
             health = 100;\r
             CharName = Name;\r
             theDisplay = mDisplay;\r
             health = 100;\r
@@ -55,7 +55,7 @@ namespace CarFire
             projectileSpeed = 30;\r
 \r
             // Speed is the number of grid cells you can move through per second.\r
             projectileSpeed = 30;\r
 \r
             // Speed is the number of grid cells you can move through per second.\r
-            mMotion = new MovementManager(position, 5.0f);\r
+            mMotion = new MovementManager(position, 8.0f);\r
         }\r
 \r
         public void LoadContent(ContentManager contentManager)\r
         }\r
 \r
         public void LoadContent(ContentManager contentManager)\r
@@ -65,26 +65,18 @@ namespace CarFire
 \r
         }\r
 \r
 \r
         }\r
 \r
-        public void UnloadContent()\r
-        {\r
-\r
-        }\r
 \r
 \r
-        public long Update(GameTime gameTime, NetworkManager networkGame)\r
+        public void Update(TimeSpan timeSpan)\r
         {\r
         {\r
-            return 0;\r
-\r
         }\r
         /// <summary>\r
         /// This method will draw a character to the screen.\r
         /// </summary>\r
         /// <param name="spriteBatch"></param>\r
         }\r
         /// <summary>\r
         /// This method will draw a character to the screen.\r
         /// </summary>\r
         /// <param name="spriteBatch"></param>\r
-        /// <returns></returns>\r
-        public long Draw(SpriteBatch spriteBatch)\r
+        public void Draw(SpriteBatch spriteBatch)\r
         {\r
         {\r
-            Rectangle position = theMap.GetRectangleFromCoordinates(mMotion.Position);\r
+            Rectangle position = game.State.Map.GetRectangleFromCoordinates(mMotion.Position);\r
             spriteBatch.Draw(charModel, position, Color.White);\r
             spriteBatch.Draw(charModel, position, Color.White);\r
-            return 0;\r
         }\r
 \r
         public int Health { get { return health; } }\r
         }\r
 \r
         public int Health { get { return health; } }\r
@@ -124,7 +116,7 @@ namespace CarFire
             Point destination = MovementManager.GetNeighborCell(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown);\r
             if (!keysPressed.Contains(Keys.LeftControl))\r
             {\r
             Point destination = MovementManager.GetNeighborCell(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown);\r
             if (!keysPressed.Contains(Keys.LeftControl))\r
             {\r
-                if (theMap.IsCellOpen(destination))\r
+                if (game.IsCellOpen(destination))\r
                 {\r
                     mMotion.Update(timeSpan, moveLeft, moveRight, moveUp, moveDown);\r
                 }\r
                 {\r
                     mMotion.Update(timeSpan, moveLeft, moveRight, moveUp, moveDown);\r
                 }\r
@@ -173,7 +165,7 @@ namespace CarFire
                     toShoot.Normalize();\r
                     toShoot *= projectileSpeed;\r
                     projectileCoolDown = shootCoolDown;\r
                     toShoot.Normalize();\r
                     toShoot *= projectileSpeed;\r
                     projectileCoolDown = shootCoolDown;\r
-                    theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,\r
+                    theDisplay.AddProjectiles(new Projectile(game.State.Map, projectileModel,\r
                         toShoot, new Point(startX, startY)));\r
 \r
                     /*\r
                         toShoot, new Point(startX, startY)));\r
 \r
                     /*\r
This page took 0.022746 seconds and 4 git commands to generate.