Game Object Creator

GOC - Codeing Standard

Include Paths

      All paths must use "/". If you do not use "/" the code you write will not work between multiple platforms. Ubuntu® forces you to use “/” and Windows® accepts either “/” or “\”. In order to prevent yourself a head ache later just get in the habit of using "/" all the time.

      Source code files are separated into a structure of normal code (platform agnostic) and platform specific code. Each section of source code is further subdivided into include files (inc) and source files (src). To include a normal header file add: "./source/inc/" to the beginning of your header file name that you want to include, and for platform specific header files add: "./source/PlatformSpecific/inc" to the beginning of your header file name.

      When navigating folder structures you can go back a folder by adding: "./../" to the begininng of your source file's path. You could also add the actual path to the source file but the absolute path will not be portable between computers or operating systems.

Examples:

				        // Normal source code header file.
				        #include "./source/inc/Render2D.h"
				
				        // Platform specific source code header file.
				        #include "./source/PlatformSpecific/inc/GOC.h"
				
				        // Navigate back to the image folder.
				        sprite_m->LoadTexture("./../images/Ball.png");
			        

Variables

      Variable names start with a lower case letter and for multiple word variables the second word and subsequent words are capitalized. Variable names end with an “_” followed by a descriptor letter. Descriptor letters are “m” for member variables, “l” for local variables, ”p” for function parameter variables, ”i” for interface variables, and “g” for global variables.

Examples:

				        // Member variable.
				        Sprite tempoarySprite_m;
				
				        // Local variable.
				        int loopCounter_l;
				
				        // Function Parameter variable.
				        Timer timerGOC_p;
				
				        // Interface variable.
				        Render2D::render2D_i();
				
				        // Global variable.
				        int evilGlobalVariable_g;
			        

Functions

      Function names begin with a capital letter, and each subsequent word in a functoin name is capitalized. Function names do not have any spaces or underscores separating each word in the function name. There is one exception to this standard and that is for interface accessor functions. Accessor interface functions are treated as variables with their names. This is to prevent interface functions from being confused with constructors of classes.

Examples:

				        // Single word function name.
				        void Test(){}
				
				        // Multiple word function name.
				        bool HasCollidedWithThing(){}
				
				        // Interface function name.
				        Render2D::render2D_i(){}
			        



Legal Info  About GOC  Contact Us