-
Notifications
You must be signed in to change notification settings - Fork 0
Code Style
#####Macros
Use ALL_CAPS separated by an underscore.
#define IN_RANGEIf macro’s replacement is not literal, it will be enclosed in parentheses.
#define RADTODEG( a ) (a * 180 / 3.1416 )If macro needs more than one line, it will be defined by backslashes aligned at the end of the line.
#define CAP(x, m, M) \
{ \
if (x < m) \
x = m; \
if (x > M) \
x = M; \
}#####Enumerations
Enumerations names will be snake_case with uppercase in initials. It’s name will define what one component is.
enum Unit_TypeEnumerations components will be defined as well as macros.
enum Collision_State
{
NONE,
IN_PROCESS
RESOLVED
}#####File Names
File will be introduced by an uppercase letter acording to the file type, follow by an underscore and the file name.
Files that dont have one of the file types won’t be introduced by the uppercase letter.
M_Input.cppFile types will be:
- Module
- Container
- Scene
- UI
#####Variable Names
camelCase will be used for variable names, trying to define the variable purpose as clear as posible
In case a variable has a sub-type, the variable name will be followed by an undrescore and the sub-type name
position_x
hpBar_mid#####Functions
Function names will be in PascalCase
void ManageInput()Function parameters: in case a function parameter needs the same name as a class variable, the parameter name will be introduced by an underscore
void SetPosition( _position )Open braces come at the next line of the function declaration. Close braces come aligned to their respective braces.
void SetPosition( _position )
{
if (_position != position)
{
position = _position;
posChanged = true;
}
else
{
pasChanged = false;
}
}“Else” and “else if” come at the next line after the “if” closing braces, aligned with “if” position.
Home
GDD
- Features: FAQ Center
- Gameplay: Game Explanation - Controls
- Races: Protoss - Zerg - Terran & Miscellanea
- Game Modes: Last Cataclysm - Capture the Flag
UI
- Menu: Starting Game
- In-Game: Main HUD - In Game Menu - Resources Display - Cursor - Icons
Art
Audio
Tech
- Code Style - Project UML
QA Plan
##Home
Gameplay
Game Explanation
Controls
Game Modes
Last Cataclysm
Capture the Flag
In game UI
Main HUD
In Game Menu
Resources Display
Cursor
Icons
Main Menu
Starting Game