X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FHuman.cs;h=08d962a1e682042ef420fab99b59b8fb52815d78;hb=af9deb873b24dadd0d509ce199fc6cac2b3efbc9;hp=519d9d02f14908767e150112472c01d7638d6bd1;hpb=851a2f1efb5e981fad8f517170809b61d630e8b7;p=chaz%2Fcarfire
diff --git a/CarFire/CarFire/CarFire/Human.cs b/CarFire/CarFire/CarFire/Human.cs
index 519d9d0..08d962a 100644
--- a/CarFire/CarFire/CarFire/Human.cs
+++ b/CarFire/CarFire/CarFire/Human.cs
@@ -22,7 +22,7 @@ namespace CarFire
const int shootCoolDown = 10;
State state;
String CharName;
- Map theMap;
+ Game game;
Texture2D charModel;
Texture2D projectileModel;
int health;
@@ -40,9 +40,9 @@ namespace CarFire
int projectileCoolDown;
- public Human(Map _theMap, String Name, Texture2D model, Texture2D projectile, Display mDisplay, Point position)
+ public Human(Game theGame, String Name, Texture2D model, Texture2D projectile, Display mDisplay, Point position)
{
- theMap = _theMap;
+ game = theGame;
CharName = Name;
theDisplay = mDisplay;
health = 100;
@@ -55,7 +55,7 @@ namespace CarFire
projectileSpeed = 30;
// Speed is the number of grid cells you can move through per second.
- mMotion = new MovementManager(position, 5.0f);
+ mMotion = new MovementManager(position, 8.0f);
}
public void LoadContent(ContentManager contentManager)
@@ -65,26 +65,18 @@ namespace CarFire
}
- public void UnloadContent()
- {
-
- }
- public long Update(GameTime gameTime, NetworkManager networkGame)
+ public void Update(TimeSpan timeSpan)
{
- return 0;
-
}
///
/// This method will draw a character to the screen.
///
///
- ///
- public long Draw(SpriteBatch spriteBatch)
+ public void Draw(SpriteBatch spriteBatch)
{
- Rectangle position = theMap.GetRectangleFromCoordinates(mMotion.Position);
+ Rectangle position = game.State.Map.GetRectangleFromCoordinates(mMotion.Position);
spriteBatch.Draw(charModel, position, Color.White);
- return 0;
}
public int Health { get { return health; } }
@@ -124,7 +116,7 @@ namespace CarFire
Point destination = MovementManager.GetNeighborCell(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown);
if (!keysPressed.Contains(Keys.LeftControl))
{
- if (theMap.IsCellOpen(destination))
+ if (game.IsCellOpen(destination))
{
mMotion.Update(timeSpan, moveLeft, moveRight, moveUp, moveDown);
}
@@ -173,7 +165,7 @@ namespace CarFire
toShoot.Normalize();
toShoot *= projectileSpeed;
projectileCoolDown = shootCoolDown;
- theDisplay.AddProjectiles(new Projectile(theMap, projectileModel,
+ theDisplay.AddProjectiles(new Projectile(game.State.Map, projectileModel,
toShoot, new Point(startX, startY)));
/*