X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FCharacterTestBed%2FCharacter.cs;fp=CarFire%2FCarFire%2FCharacterTestBed%2FCharacter.cs;h=3ebb093270c066a543cf580c9e71cc0db3889482;hb=6c6a37b3b7f5d74475e2211616fe2a2ab7c6e508;hp=0000000000000000000000000000000000000000;hpb=f58af70a5768c1d99ca535fb214565ba226f3f0f;p=chaz%2Fcarfire diff --git a/CarFire/CarFire/CharacterTestBed/Character.cs b/CarFire/CarFire/CharacterTestBed/Character.cs new file mode 100644 index 0000000..3ebb093 --- /dev/null +++ b/CarFire/CarFire/CharacterTestBed/Character.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace CarFire +{ + /// + /// Base class for all Characters, + /// includes: basic position information, + /// character Texture + /// health + /// damage + /// + public class Character + { + //Member Variables + Map theMap; + int movementSpeed; + int gridX; + int gridY; + Texture2D charModel; + int health; + int damage; + int range; + bool isMoving; + int pixelX; + int pixelY; + + /// + /// Call this method to give the game a chance to load its content. + /// + /// The map that this character will interact with + /// The model for this character + /// How fast the character moves + /// The starting health of the character + /// The base damage of the character + /// The range of the character attack + public Character( Map _currentMap, + Texture2D _charModel, + int _baseMovementSpeed, + int _baseHealth, + int _baseDamage, + int _baseRange) + { + theMap = _currentMap; + movementSpeed = _baseMovementSpeed; + gridX = 100; //should be included in the map as a designated spawn point to begin map + gridY = 100; // + charModel = _charModel; + health = _baseHealth; + range = _baseRange; + isMoving = false; + pixelX = gridX * 1; // 1 needs to be changed to the size of the map grid, also someway need to be determined to change to screen cordinates from would the world cordinates + pixelY = gridY * 1; // + } + + public void Draw(SpriteBatch spriteBatch) + { + spriteBatch.Draw(charModel, new Vector2(pixelX, pixelY), null, Color.White, 0, new Vector2(0f,0f), 1f, SpriteEffects.None, 0); + } + + /// + /// Adjust Health of player + /// + public int Health + { + get { return health; } + set { health = value; } + } + + public bool IsMoving + { + get { return isMoving; } + } + } + + /// + /// A manager class to handle network interactions between peers and + /// lobby/game switching. + /// + public class Player : Character + { + //Member Variables + + public Player( Map _currentMap, + Texture2D _charModel, + int _baseMovementSpeed, + int _baseHealth, + int _baseDamage, + int _baseRange) + : base(_currentMap,_charModel,_baseMovementSpeed, _baseHealth, _baseDamage, _baseRange) + { + } + + public void Update() + { + + } + } + + /// + /// A manager class to handle network interactions between peers and + /// lobby/game switching. + /// + public class Monster : Character + { + //Member Variables + public Monster( Map _currentMap, + Texture2D _charModel, + int _baseMovementSpeed, + int _baseHealth, + int _baseDamage, + int _baseRange) + : base(_currentMap,_charModel,_baseMovementSpeed, _baseHealth, _baseDamage, _baseRange) + { + + } + + public void Update() + { + + } + } + + //this is for testing purposes only! + public class Map + { + public Map() + { + + } + } +} \ No newline at end of file