Thread: RPG Map Editors?

  1. #1

    Question 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
    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.

  2. #2
    Registered User Aran's Avatar
    Join Date
    Aug 2001
    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.

  3. #3
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem
    By ExDHaos in forum C++ Programming
    Replies: 12
    Last Post: 05-22-2009, 04:50 AM
  2. Polynomials and ADT's
    By Emeighty in forum C++ Programming
    Replies: 20
    Last Post: 08-19-2008, 08:32 AM
  3. Creating a map engine.
    By suzakugaiden in forum Game Programming
    Replies: 11
    Last Post: 06-21-2005, 05:06 AM
  4. RPG 2d Game Map Editor?
    By drdroid in forum Game Programming
    Replies: 1
    Last Post: 01-08-2003, 01:17 PM
  5. Searching STL Map Inside STL Map Object :: C++
    By kuphryn in forum C++ Programming
    Replies: 2
    Last Post: 11-14-2002, 09:11 AM