RPG Map Editors?

This is a discussion on RPG Map Editors? within the Game Programming forums, part of the General Programming Boards category; Well, I was thinking about this. I have seen a lot of top-down RPG's with map editors(Warcraft 2 and more), ...

  1. #1
    SytnaxBubble
    Guest

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

  2. #2
    Registered User Aran's Avatar
    Join Date
    Aug 2001
    Posts
    1,301
    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
    Satan valar_king's Avatar
    Join Date
    Aug 2001
    Posts
    288
    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, 12:17 PM
  5. Searching STL Map Inside STL Map Object :: C++
    By kuphryn in forum C++ Programming
    Replies: 2
    Last Post: 11-14-2002, 08:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21