|
-
December 6th, 2012, 03:48 PM
#1
C++ Text based game..
Hello everyone, am new. I wondered if could help me get my head around the coding side of things.
I have started to make a text based game for uni, its part of the course.
I know what I need in it, I know what to do.. but for the life of me I cant code the thing.
My first mission on this is to first display a random x and y coordinates of both you (the player and 10 enemies on a 10x10 grid)
Bare in mind that i dont have to make the grid, just put if statements on the coordinates to limit the number from going any higher than 10.
Here are the classes... I would i go about doing this?
Code:
class Characters
{
protected:
int x,y; // co-ordinate position
public:
Characters(int pos_x,int pos_y) {
x=pos_x;
y=pos_y;
}
};
class Bunnymonsters : public Characters
{
};
class Hero : public Characters
{
public:
//Create Hero
};
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|