So, I haven't really updated my blog in a bit because the power unit
in my PC went down and I had to wait to get paid before I could purchase
a new one. I feel bad because I was in zero contact with my cohort and
I have no idea where he is in the project right now. (Honestly wouldn't
be surprised if he has passed me up by now)
Well anyway I have begun work on what I was originally supposed to work
on the unit and weapon class. So far all I have is the header file but it is rough
outline of what the units and weapon classes will be composed of.
units.h (Specifically holds the unit and weapon class)
That is what I have so far so please let me know what you think and any ideas or suggestions you may have.
in my PC went down and I had to wait to get paid before I could purchase
a new one. I feel bad because I was in zero contact with my cohort and
I have no idea where he is in the project right now. (Honestly wouldn't
be surprised if he has passed me up by now)
Well anyway I have begun work on what I was originally supposed to work
on the unit and weapon class. So far all I have is the header file but it is rough
outline of what the units and weapon classes will be composed of.
units.h (Specifically holds the unit and weapon class)
class weapon
{
public:
//constructors
weapon();
weapon(string name, int ID, char type, int minRange, int maxRange, int force);
//return values of items in the weapon class
string retName();
int retID();
char retType();
int retminRange();
int retmaxRange();
int retForce();
private:
string wName; //string to show name of the exact weapon
int wID; //numerical ID for quick organization
char wType; // use things like 'S' for sword and 'B' bow 'P' polearm etc
int wminRange; //the closest the target can be from the weapon before it becomes less useful
int wmaxRange; //the farthest the target can be from the weapon before it becomes less useful if not useful at all
int force; //The amount of power it adds the unit
};
class unit
{
public:
//constructors
unit();
unit(string name, int ID, weapon mWeapon, int attackOne, weapon rWeapon, int attackTwo, int xp);
//add xp (TO BE USED LATER)
void addXP(int someXP);
//return values
string retName();
int retID();
weapon retmWeapon();
int retattackOne();
weapon retrWeapon();
int retattackTwo();
int retXP();
private:
string uName; //string name to display a unit name to the user
int uID; //numerical id for quick organization
weapon umWeapon; //using the weapon class i can store a ranged weapon here
int uattackOne; // the strength of the units melee attack plus whatever the force of the weapon is
weapon urWeapon; // using weapon class i can store a ranged weapon here
int uattackTwo; // the strength of the units ranged attack plus whatever the force of the weapon is
int uXP;
};
That is what I have so far so please let me know what you think and any ideas or suggestions you may have.
1 Comments On This Entry
Page 1 of 1
Martyr2
04 July 2009 - 10:49 PM
Looks like a good start to me. The only advice I have is to remember to keep extensibility in mind for the future because both weapons and units will be two classes that you will find yourself upgrading a lot if your game is successful. So take the extra time on them to make sure that it is easy to add extra attributes (enchant a weapons for instance? Durability?) and add new unit types based on those two classes.
Page 1 of 1
Recent Entries
-
-
And We're backon Jul 02 2009 02:54 PM
-
Off to the raceson Jun 19 2009 01:22 PM
-
Quickieon Jun 16 2009 08:54 PM
-
Recent Comments
Search My Blog
← January 2022 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Files Used In Blog
My Blog Links
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)



1 Comments









|