GCI Student Bootstrap
              From Bitfighter            
            Revision as of 20:55, 21 November 2013 by Watusimoto  (Talk | contribs)
Welcome
Welcome GCI students!
This page is to help you get set-up with Bitfighter. If you have any questions, please come by our IRC channel: #bitfighter
Preparation
You need the following software to build bitfighter:
-  Mercurial
- Windows / OSX: http://mercurial.selenic.com/downloads/
 - Linux: Install your distribution 'mercurial' package
 
 -  CMake
- Windows / OSX: http://www.cmake.org/cmake/resources/software.html
 - Linux: Install your distribution 'cmake' package
 
 -  Compiling/editing environment
- Windows: Visual Studio 2013/2010 are known to work
 - OSX: We only have an old Xcode 3 project, so you might want to use a different OS
 - Linux: Anything you want! you'll be using 'make' and GCC to compile
 
 -  Create server-side clone
- Go to http://code.google.com/p/bitfighter/source/clones and click 'Create a Clone'
 
 -  Check-out the code.  See the 'Checkout' option in your server-side clone
- Command-line command: hg clone <SOME_URL>
 - Using TortoisHG. Click 'clone'
 
 
Building
Steps to build Bitfighter. For more detailed information, see Building Bitfighter
Linux users, you will have to install dependecies found here: http://bitfighter.org/wiki/index.php/Building_Bitfighter#Detailed_Instructions
-  Create project files for compiling
- Open a terminal and go into the 'build' sub-directory
 -  Run the appropriate 'cmake' command for your platform:
- Linux command: cmake -DCMAKE_BUILD_TYPE=Debug ..
 -  Windows command:  cmake -G "Visual Studio 2010" ..
- You can use "Visual Studio 2013" as well
 
 - OSX command: nothing to be done, use the Xcode 3 projects or run on a different OS.
 
 
 -  Compile!
-  Windows:
- Open the solution file created by the cmake command in Visual Studio (found in the 'build' directory)
 - Select 'Debug' build
 - Once open, right-click on the 'bitfighter' project and click 'build'
 
 -  Linux:
- In the 'build' directory, type 'make'
 - Change to the '../exe' directory
 - Run this command to make resources available: for file in `ls -1 ../resource` ; do ln -s ../resource/$file ; done
 
 - OSX: Build the application target in the Xcode 3 project (or use another OS)
 
 -  Windows:
 - Run the game! It is found in the 'exe' directory, as 'bitfighter' or 'bitfighter.exe'
 
Coding Standards
- Whitespace: Indent 3 spaces (no tabs), two blank lines between functions.
 - Whitespace: No spaces around parens (e.g. if(x == 3), not if ( x == 3)).
 - Braces: Opening braces go on a new line
 - Line endings: Use Unix standard line endings (i.e. \n).
 - Comments: Prefer C++ comments (//) to C style (/* */).
 - Loop variables: For outer loops use i, for inner loops use j, unless there is good reason not to.
 - Do not use increment operators embedded inside an expression (e.g. x = ++y).
 - If you must use new, add a comment indicating how it is cleaned up.
 - Add a comment demarcating constructors and destructors to make searching easier (see code for examples).
 - Member variables in classes should start with "m" and should be private or protected. Use getters/setters for external access.
 - Avoid global variables.
 - Use parens to clarify complex expressions, even if not strictly required. (e.g. x = (y / z) + a)
 - Above all, make your code clear!
 
