]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/Human.cs
Basic character selection screen.
[chaz/carfire] / CarFire / CarFire / CarFire / Human.cs
index 08d962a1e682042ef420fab99b59b8fb52815d78..3897491da0305896fb6674f3f13f08f0261282f1 100644 (file)
@@ -11,16 +11,8 @@ namespace CarFire
 {\r
     public class Human : IPlayer\r
     {\r
-        public enum State\r
-        {\r
-            left,\r
-            right,\r
-            up,\r
-            down\r
-        };\r
         //The number of frames between each projectile is spawned.\r
-        const int shootCoolDown = 10;\r
-        State state;\r
+        const int shootCoolDown = 18;\r
         String CharName;\r
         Game game;\r
         Texture2D charModel;\r
@@ -31,37 +23,30 @@ namespace CarFire
         int score;\r
 \r
         MovementManager mMotion;\r
-\r
         bool visible;\r
-        Display theDisplay;\r
 \r
         //Used to draw projectiles\r
         int projectileSpeed;\r
         int projectileCoolDown;\r
         \r
 \r
-        public Human(Game theGame, String Name, Texture2D model, Texture2D projectile, Display mDisplay, Point position)\r
+        public Human(Game theGame, String Name, Point position)\r
         {\r
             game = theGame;\r
             CharName = Name;\r
-            theDisplay = mDisplay;\r
             health = 100;\r
             score = 0;\r
             visible = false;\r
-            //default state\r
-            state = State.up;\r
-            charModel = model;\r
-            projectileModel = projectile;\r
-            projectileSpeed = 30;\r
+            projectileSpeed = 8;\r
 \r
             // Speed is the number of grid cells you can move through per second.\r
-            mMotion = new MovementManager(position, 8.0f);\r
+            mMotion = new MovementManager(position, 4.0f);\r
         }\r
 \r
         public void LoadContent(ContentManager contentManager)\r
         {\r
-            charModel = contentManager.Load<Texture2D>("deselectBox"); //change to charModel when designed\r
-            projectileModel = contentManager.Load<Texture2D>("emptySelectBox"); //change to a projectile model later\r
+            charModel = contentManager.Load<Texture2D>("cs"); //change to charModel when designed\r
+            projectileModel = contentManager.Load<Texture2D>("projectile"); //change to a projectile model later\r
 \r
         }\r
 \r
@@ -104,15 +89,6 @@ namespace CarFire
             bool moveRight = keysPressed.Contains(Keys.Right);\r
             bool moveUp = keysPressed.Contains(Keys.Up);\r
             bool moveDown = keysPressed.Contains(Keys.Down);\r
-            if (moveLeft)\r
-                state = State.left;\r
-            else if (moveRight)\r
-                state = State.right;\r
-            else if (moveUp)\r
-                state = State.up;\r
-            else if (moveDown)\r
-                state = State.down;\r
-\r
             Point destination = MovementManager.GetNeighborCell(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown);\r
             if (!keysPressed.Contains(Keys.LeftControl))\r
             {\r
@@ -165,35 +141,10 @@ namespace CarFire
                     toShoot.Normalize();\r
                     toShoot *= projectileSpeed;\r
                     projectileCoolDown = shootCoolDown;\r
-                    theDisplay.AddProjectiles(new Projectile(game.State.Map, projectileModel,\r
+                    game.State.mDisplay.AddProjectiles(new Projectile(game.State.Map, projectileModel,\r
                         toShoot, new Point(startX, startY)));\r
 \r
-                    /*\r
-                    if (state == State.up)\r
-                    {\r
-                        projectileCoolDown = shootCoolDown;\r
-                        theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,\r
-                            new Vector2(0, -projectileSpeed), new Point(Coordinates.X, Coordinates.Y - 1)));\r
-                    }\r
-                    if (state == State.down)\r
-                    {\r
-                        projectileCoolDown = shootCoolDown;\r
-                        theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,\r
-                            new Vector2(0, projectileSpeed), new Point(Coordinates.X, Coordinates.Y + 1)));\r
-                    }\r
-                    if (state == State.right)\r
-                    {\r
-                        projectileCoolDown = shootCoolDown;\r
-                        theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,\r
-                            new Vector2(projectileSpeed, 0), new Point (Coordinates.X + 1, Coordinates.Y)));\r
-                    }\r
-                    if (state == State.left)\r
-                    {\r
-                        projectileCoolDown = shootCoolDown;\r
-                        theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,\r
-                            new Vector2(-projectileSpeed, 0), new Point(Coordinates.X - 1, Coordinates.Y)));\r
-                    }\r
-                     */\r
+             \r
                 }\r
             }\r
         }\r
This page took 0.027506 seconds and 4 git commands to generate.