View Full Version : Game and Editor ??
NYGhost
2002.12.16, 03:53 PM
Hello forum
I'm coding a arcade type shooter on 3D using C++, so far everything's going smooth.
The way I'm doing the code is with two builds one which is the editor, and the other is the actual game.
The code is exactly the same for the game except that there are no GUI controls for the game objects.
e.g
#ifdef EDITOR
InitGUIControls()
EditorLoop()
#else
InitGame()
GameLoop()
#endif
Is this an OK approach or is there an easier way to handle both editor and game projects.
Thanks
henryj
2002.12.16, 04:47 PM
There's no problem doing it this way, though I would soon get sick of having to compile everything twice.
How about putting a flag in a config file or maybe a key combination to switch to the editor?
Joseph Duchesne
2002.12.17, 02:29 PM
I ame doing that to but I am makeing a RPG. An integrated level editor would be cool but it's to much work in Metal.
Darkgold
2002.12.17, 05:12 PM
I'm doing an RPG in Metal that does have a level editor. However I'm releasing them as two separate programs. Joseph, why can't you add an editor to yours?
Zachary
2002.12.18, 11:54 AM
is everybody who uses metal making an rpg?
P.S: Yay, new smilies! *| :eh?: ;)
Darkgold
2002.12.18, 01:40 PM
Nope, just us three.
Quicksilver
2002.12.18, 01:41 PM
QS isn't.:D
NYGhost
2002.12.18, 01:45 PM
The reason I'm doing this project is to get familiar with real game development challenges, so I decided to go with c++.
Is hard, but rewarding when I get something working :rolleyes:
geezusfreeek
2002.12.18, 06:04 PM
If you are careful you could probably link shared files in each of your projects simply using the same file for both. You would just have to make sure that you take into account that what you do to the code in a file in respect to one project will also affect the other project.
It's still a double compile, but I bet a little tweaking could save compiling time by only recompiling code that is unique to each project. That is, if you make changes in both projects and then compile them, the first one will compile all altered files in the project, then the second will simply compile the files the first compile did not. Linking should be correct either way.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.