| New Objects | |
|
|
Author | Message |
---|
daemonfire
Posts : 9 Join date : 2010-04-20
| Subject: New Objects Fri Apr 23, 2010 3:34 pm | |
| Hi there,
I would suggest to add the following Objects:
*Item *Player *Monster (*Inventory)
and start a brainstorm about the "what does this object and which properties does it have", e.g. "move()" etc. =) | |
|
| |
Jonas Admin
Posts : 23 Join date : 2010-04-11
| Subject: Re: New Objects Fri Apr 23, 2010 7:53 pm | |
| Good good. But we are already doing that. Keep coming with the suggestions | |
|
| |
Philipp
Posts : 23 Join date : 2010-04-11
| Subject: Re: New Objects Sat Apr 24, 2010 1:14 am | |
| I was thinking about that already. I want to start with a class ("object") that is the parent class of all other "object" classes. I am working on the structure of those classes right now. I will upload them as soon as I am finished. | |
|
| |
daemonfire
Posts : 9 Join date : 2010-04-20
| Subject: Re: New Objects Sat Apr 24, 2010 11:12 am | |
| The question is, if you try to develope with OOP why do we have to create an abstract "object" class?
It would make sense if you implement some kind of exception handling to the parent class, but what "function" will "Object" have? | |
|
| |
Philipp
Posts : 23 Join date : 2010-04-11
| Subject: Re: New Objects Sat Apr 24, 2010 1:55 pm | |
| The "Object" class will be the parent class of all drawable things (it will be renamed I think). So its functionality will be all the things every drawable thing will need. Maybe this class is not needed since there is sf::Sprite that provides a lot of useful functions already. I don't know yet. Maybe this class will not even be abstract. There will be a good exception handling in this project. | |
|
| |
daemonfire
Posts : 9 Join date : 2010-04-20
| Subject: Re: New Objects Sat Apr 24, 2010 6:45 pm | |
| I think you should rename "Object" to something like "GameObject".
Quests e.g. which are (to use your words) non-drawable could derive/inherit from a class called "AbstractGameObject". | |
|
| |
Philipp
Posts : 23 Join date : 2010-04-11
| Subject: Re: New Objects Sat Apr 24, 2010 7:20 pm | |
| Check out the new structure. I think it's quiet okay so far. | |
|
| |
daemonfire
Posts : 9 Join date : 2010-04-20
| Subject: Re: New Objects Sun Apr 25, 2010 2:59 pm | |
| The "#IF_nDEF".... is for using such ".hpp" header files instead of ".h" (C) header files? Or why do you add it every time? =) | |
|
| |
Philipp
Posts : 23 Join date : 2010-04-11
| Subject: Re: New Objects Sun Apr 25, 2010 9:11 pm | |
| ".h" is a header file for C. C++ can either use ".h" or ".hpp" (there are even more).
So you really can decide by yourself what you want to use. I decided that I will use .hpp since sfml lib uses .hpp, too.
The "#ifndef ..." pre-processor command is used to make sure the header is compiled only once. If there would be two files that include the same header and there wouldn't be the "#ifndef ..." it would not work. | |
|
| |
Sponsored content
| Subject: Re: New Objects | |
| |
|
| |
| New Objects | |
|