-
RPG Map Editors?
Well, I was thinking about this. I have seen a lot of top-down RPG's with map editors(Warcraft 2 and more), and I have a question. For the objects in the map, if I had a simple class:
class OBJ
{
public:
int numobj; // Number of objects
int tileX; // Object's X tile
int tileY; // Object's Y tile
int otype; // Object's type
char *alias; // Object's name
};
then in the editor, when the user were to add an object, would I just do this?:
OBJ* o;
o.numobj += 1;
o = new OBJ[o.numobj];
and delete:
delete o[numtodelete];
or is it much more complex? Well, any help is appreciated.
-
you could just make an array of 1000 objects to start... although that may be ridiculously space wasting, it would save you the trouble of using new and delete all the time.
-
You seem to be putting in a system similiar to a linked list. If you do not know about them, check out the tuts section on this site.