It's about a world of rooms. Each room has some objects including a shield and a key. A person can move either up, down, left or right. When the person is in the same position as the key or shield he gets it. Each key can open the door to another room. This is to be done in C++. HELP PLEASE!!
I need to create a UML class diagram for a game in C++. This is urgent. Could someone help me please??
I believe you want to use UML to describe objects in you game. Once you've done this, it shouldn't be too hard to implement it in C++:
class name: player
attributes: int x_position, int y_position
operations: up(), down(), left(), right()
this would translate to something like:
class player {
private:
int x_position;
int y_position;
public:
void up();
void down();
void left();
void right();
};
More importantly though, you'll have to model the ALL the objects and assign them relationships. Such as a "room" object and this room object can have one or more "item" objects in it, etc...
Reply:An UML diagram has nothing to do with the programming language, basically it's a diagram where you draw all the classes that you are going to need with its attributes and its methods and you join this classes with what is called an association. I'm not going into much detail here beacause it would be quite long but you can check out this websites:
http://www.objectmentor.com/resources/ar...
http://www.dotnetcoders.com/web/learning...
http://pigseye.kennesaw.edu/~dbraun/csis...
Good luck
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment