]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/CharacterTestBed/Character.cs
began on the basic character, player, and monster classes. Also created a second...
[chaz/carfire] / CarFire / CarFire / CharacterTestBed / Character.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 /// <summary>
13 /// Base class for all Characters,
14 /// includes: basic position information,
15 /// character Texture
16 /// health
17 /// damage
18 /// </summary>
19 public class Character
20 {
21 //Member Variables
22 Map theMap;
23 int movementSpeed;
24 int gridX;
25 int gridY;
26 Texture2D charModel;
27 int health;
28 int damage;
29 int range;
30 bool isMoving;
31 int pixelX;
32 int pixelY;
33
34 /// <summary>
35 /// Call this method to give the game a chance to load its content.
36 /// </summary>
37 /// <param name="_currentMap">The map that this character will interact with</param>
38 /// <param name="_charModel">The model for this character</param>
39 /// <param name="_baseMovementSpeed">How fast the character moves</param>
40 /// <param name="_baseHealth">The starting health of the character</param>
41 /// <param name="_baseDamage">The base damage of the character</param>
42 /// <param name="_baseRange">The range of the character attack</param>
43 public Character( Map _currentMap,
44 Texture2D _charModel,
45 int _baseMovementSpeed,
46 int _baseHealth,
47 int _baseDamage,
48 int _baseRange)
49 {
50 theMap = _currentMap;
51 movementSpeed = _baseMovementSpeed;
52 gridX = 100; //should be included in the map as a designated spawn point to begin map
53 gridY = 100; //
54 charModel = _charModel;
55 health = _baseHealth;
56 range = _baseRange;
57 isMoving = false;
58 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
59 pixelY = gridY * 1; //
60 }
61
62 public void Draw(SpriteBatch spriteBatch)
63 {
64 spriteBatch.Draw(charModel, new Vector2(pixelX, pixelY), null, Color.White, 0, new Vector2(0f,0f), 1f, SpriteEffects.None, 0);
65 }
66
67 /// <summary>
68 /// Adjust Health of player
69 /// </summary>
70 public int Health
71 {
72 get { return health; }
73 set { health = value; }
74 }
75
76 public bool IsMoving
77 {
78 get { return isMoving; }
79 }
80 }
81
82 /// <summary>
83 /// A manager class to handle network interactions between peers and
84 /// lobby/game switching.
85 /// </summary>
86 public class Player : Character
87 {
88 //Member Variables
89
90 public Player( Map _currentMap,
91 Texture2D _charModel,
92 int _baseMovementSpeed,
93 int _baseHealth,
94 int _baseDamage,
95 int _baseRange)
96 : base(_currentMap,_charModel,_baseMovementSpeed, _baseHealth, _baseDamage, _baseRange)
97 {
98 }
99
100 public void Update()
101 {
102
103 }
104 }
105
106 /// <summary>
107 /// A manager class to handle network interactions between peers and
108 /// lobby/game switching.
109 /// </summary>
110 public class Monster : Character
111 {
112 //Member Variables
113 public Monster( Map _currentMap,
114 Texture2D _charModel,
115 int _baseMovementSpeed,
116 int _baseHealth,
117 int _baseDamage,
118 int _baseRange)
119 : base(_currentMap,_charModel,_baseMovementSpeed, _baseHealth, _baseDamage, _baseRange)
120 {
121
122 }
123
124 public void Update()
125 {
126
127 }
128 }
129
130 //this is for testing purposes only!
131 public class Map
132 {
133 public Map()
134 {
135
136 }
137 }
138 }
This page took 0.036801 seconds and 4 git commands to generate.