Hey everyone, Lately i have decided that I wanted to redo my “RPG” map class design because right now it just isnt really friendly enough to expand much, and am kind of getting lost on having each level hold all the data in a file (so the map editor i create will be able to create levels all on its own) I was thinking i would output all the info from the map editor into XML and then read it in the engine, would that be a workable method?
Also with that, I am kind of getting lost on Items and Enemies and was wondering if I am on the right track or if someone can help clear it up for me.
I was thinking I could have the user be able to add items in the map editor ( give its attributes like how powerful it is or w.e) and because my engine uses Rectangle collision I wouldnt need to read it in from a tilemap or anything so i could just output in XML the item type, value, etc?
But also, one thing is should I have a master list of all the items in the game (0- w.e) then load that into the map editor, then when the user clicks lets say item 1 (potion) the map editor will export item type to be 1, then the engine will call from a master item type arraylist, 1, Would i have a class that loads up all Items and then the engine calls it and asks it to return the item to its number, or should I have it so that when a user adds an Item to the map editor they need to specify the values and what not so that when the engine reads in the xml it can just create it on the fly? . I wouldnt want to have to load every single item in the game just for a certain level, so should each level just have a master list of items, enemies and "images’ that it will use?
Or opposite of that method should I just allow the user (its just going to be me using really so it doesnt have to be too friendly) to define object type, name, and position, then the engine will create an new Item of Type, so if it were a potion, it would create a new Potion with the name “name”, and the Potion class will use “name” to call a LUA file that will set up the potion specific Attributes, I really think this method would be best.
Sorry for the sloppy typing and if its not clear, im just really trying to straighten things out.
Help is appreciated!