   Level editor object-orientated-design
  Hello,I'm want to start with building a level editor for a simple 2d game. But I don't have any experience with that, how do I do that ( programming-wise )?I preferably want something like dragging a gun into the scene, then be able to say what kind of gun that is, and set it's properties.My first thought was: I have all my classes derived from a base class which subscribes itself to the "content explorer", and then it lists what is subscribed, and you can drag that in..How can I handle setting the properties? With using a common base class you don't know which properties are relevant to the derived class...How are these things done in general? What's a good setup for a world editor?Cheers,   
  I'm doing that right now, usign Qt 4.5 and VS2005. Very easy to work with Qt.I'm using a derieved class from QGLWidget (which uses OpenGL) to draw my sprites (textures). After I create I level, I stored it in a binary format that my game engine reads. By the way, my scene graph is just a simple vector of elements (static sprites or animated sprites). Do not forget to not render what is outside your camera in your game (not required in your editor.)Hope this helps.   ;Quote:Original post by ricardo_ruiz_lopezHope this helps.Not really no, but thanks anyway.I was more looking for a clean design solution to having the game objects being represented in the editor in a way they are customizable.   ;  I'd say; keep it simple. Just hard code stuff in an make it work, once you've got a basic version it up and running you'll know which parts to generalize and make nice, but for now, don't focus too much on making it "perfect". Don't know which language your using but I'd recommend C# for any tools (such as an editor), since making the interface is just so much easier in it. Then you'd also have a solution for "setting the properties" (have a look at PropertyGrid). Drawing 2d can be done by making your own control and overriding OnPaint, it's really simple. Exporting data can be done in two ways; if you use some other .Net language for your client you can just use the Serializable attribute and the binary formatter. Otherwise I'd suggest exporting to XML.Good luck!   