Game Development Community

Where to put game specific c++ code?

by Storm Kiernan · in Torque Game Builder · 02/11/2012 (4:15 pm) · 3 replies

I am not sure where to put my game specific C++ code. I've looked at:

http://tdn.garagegames.com/wiki/Code/How_do_I_make_a_scriptable_object%3F

and

http://tdn.garagegames.com/wiki/Code/How_do_I_make_an_object_with_a_datablock%3F

and feel that it's necessary to start writing some c++.

#1
02/13/2012 (1:31 pm)
I'm no pro, but this is my understanding:

If you are using Visual Studio, open the solution for T2D. Once the solution is open you will have a bunch of projects. The one that actually compiles into your game is the TGBGame project, so if you place your files in that project they will be included in the executable for your game.

To keep the file locations consistent, it might help to make sure you place new files in the \engine\source folder and not in \engine\compilers\VisualStudio 2010 (or 2008) folder that Visual Studio will default to when you select to add a new item to a project.

#2
02/14/2012 (3:34 pm)
This works. Thank you for your help.
#3
02/14/2012 (3:40 pm)
Ditto on @Jonathon's comment. If you were wondering if you could create object files and put them in a directory, the answer is no. You need to edit the source C++ and re-compile the game.