]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/CarFire/Melee.cs
Melee and Ranged now inheret from Player
[chaz/carfire] / CarFire / CarFire / CarFire / Melee.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.Graphics;
8 using Microsoft.Xna.Framework.Input;
9
10 namespace CarFire
11 {
12 public class Melee : Player
13 {
14 #region Member Variables
15 const int hitCoolDown = 18;
16 const int baseHealth = 200;
17 const int baseDamage = 30;
18 Texture2D charModel;
19 Texture2D projectileModel;
20 #endregion
21
22 #region Public Methods
23 public Melee(Game theGame, String Name, Point position, int playerIndex)
24 : base(theGame, Name, position, playerIndex, baseHealth, baseDamage)
25 {
26 projectileSpeed = 8;
27 }
28 #endregion
29
30 #region Overridden Methods From Player
31 public override void LoadContent(ContentManager contentManager)
32 {
33 charModel = contentManager.Load<Texture2D>("cs"); //change to charModel when designed
34 projectileModel = contentManager.Load<Texture2D>("projectile"); //change to a projectile model later
35
36 }
37 /// <summary>
38 /// This method will draw a character to the screen.
39 /// </summary>
40 /// <param name="spriteBatch"></param>
41 public override void Draw(SpriteBatch spriteBatch)
42 {
43 Rectangle position = Game.State.Map.GetRectangleFromCoordinates(Motion.Position);
44 spriteBatch.Draw(charModel, position, Color.White);
45 }
46
47 public override void Attack(List<Keys> keysPressed)
48 {
49 if (hitCoolDown > 0)
50 hitCoolDown--;
51 else if (hitCoolDown == 0)
52 {
53 if (keysPressed.Contains<Keys>(Keys.Space))
54 {
55
56 }
57 }
58
59
60 }
61 #endregion
62 }
63 }
This page took 0.036258 seconds and 5 git commands to generate.