X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FPlayer.cs;h=6af9f194508ece7e82bf106675fff3370edba670;hb=51e2ac05cd36fffa4fd39d592c5df91dae4752ed;hp=f1d121c1907a0395ddeb2cab037a5b202bf4ad3f;hpb=0470a7b148c79aaacf0d8107b5bd40fa1e81ac0a;p=chaz%2Fcarfire
diff --git a/CarFire/CarFire/CarFire/Player.cs b/CarFire/CarFire/CarFire/Player.cs
index f1d121c..6af9f19 100644
--- a/CarFire/CarFire/CarFire/Player.cs
+++ b/CarFire/CarFire/CarFire/Player.cs
@@ -10,10 +10,11 @@ using Microsoft.Xna.Framework.Input;
namespace CarFire
{
- public class Player : ICharacter
+ public abstract class Player : ICharacter
{
#region Member variables
//The number of frames between each projectile is spawned.
+ const float basePlayerSpeed = 4.0f;
const int shootCoolDown = 18;
String CharName;
Game game;
@@ -24,7 +25,24 @@ namespace CarFire
int mPlayerIndex;
#endregion
+ #region Public Properties
+ public int Health { get { return playerHealth; } set{playerHealth = value;} }
+ public int Score { get { return score; } }
+ public bool alive { get { return playerHealth > 0; } }
+ public Game Game { get { return game; } }
+ public MovementManager Motion { get { return mMotion; } }
+ public int PlayerIndex { get { return mPlayerIndex; } }
+ public Vector2 Position { get { return mMotion.Position; } }
+ public Point Coordinates { get { return mMotion.Coordinates; }
+ set
+ {
+ Coordinates = value;
+ mMotion = new MovementManager(value, basePlayerSpeed);
+ } }
+ public int Damage { get { return playerDamage; } set { playerDamage = value; } }
+ #endregion
+ #region Public Methods
public Player(Game theGame, String Name, Point position, int playerIndex, int health, int damage)
{
game = theGame;
@@ -37,29 +55,6 @@ namespace CarFire
// Speed is the number of grid cells you can move through per second.
mMotion = new MovementManager(position, 4.0f);
}
-
- public virtual void LoadContent(ContentManager contentManager)
- {
-
- }
- ///
- /// This method will draw a character to the screen.
- ///
- ///
- public virtual void Draw(SpriteBatch spriteBatch)
- {
- }
-
- public int Health { get { return playerHealth; } }
- public int Score { get { return score; } }
- public bool alive { get { return playerHealth > 0; } }
- public Game Game { get { return game; } }
- public MovementManager Motion { get { return mMotion; } }
- public int PlayerIndex { get { return mPlayerIndex; } }
- public Vector2 Position { get { return mMotion.Position; } }
- public Point Coordinates { get { return mMotion.Coordinates; } }
- public int Damage { get { return playerDamage; } }
-
public void causeDamageTo(int amount)
{
playerHealth -= amount;
@@ -106,10 +101,7 @@ namespace CarFire
mMotion.LockUpdate(timeSpan, moveLeft, moveRight, moveUp, moveDown);
}
}
- public virtual void Attack(List keysPressed)
- {
-
- }
+
public void powerUp(int amount)
{
playerHealth += amount;
@@ -117,8 +109,29 @@ namespace CarFire
public void Spawn(Vector2 spawn)
{
-
+
+ }
+ public void AddHealth(int healthBoost)
+ {
+ Health += healthBoost;
+ }
+ public void IncreaseDamage(int damageBoost)
+ {
+ Damage += damageBoost;
}
+ #endregion
+
+ #region Abstract Methods
+ public abstract void PlayAttackSound();
+ public abstract void PlayDieSound();
+ public abstract void LoadContent(ContentManager contentManager);
+ ///
+ /// This method will draw a character to the screen.
+ ///
+ ///
+ public abstract void Draw(SpriteBatch spriteBatch);
+ public abstract void Attack(List keysPressed);
+ #endregion
}