- To capture new tasks write:
// TODO(user): do some feature
- For consistency, every line comment is above that line:
// Getting database controller
Models::getInstance();
- Sometimes if code is short enough you can align multiple line comments
game->handleEvents(); // handle any user input
game->update(); // update all objects eg. positions etc.
game->render(fps); // render changes to the display
- Every file has main author at the top and explanation of it
(collaborators are exceptional)
: main.cpp:
/*
<summary>startup file, counts fps, runs main loop</summary>
<author>barkausa</author>
<collab>waheedi</collab>
*/
- Every function description must be above its head in .h
(if possible)
file:- Function can be described using those as tags:
- summary - description of the function
- remarks - additional comments
- param - description about parameters
- example - if needed give an example
- returns - describes what function returns
- Function can be described using those as tags:
// <sumarry>
// Function mines a block, notifies inventory to add mineral
// </summary>
// <remarks>
// Function frozes a little bit the program (can be improved)
// </remarks>
// <param name="map">Current drawable map</param>
// <param name="player">Current player map</param>
// <param name="dx">Minable block x</param>
// <param name="dy">Minable block y</param>
static void mineBlock(Map *map, Player *player, int dx, int dy);
class Player: public TextureObject {
public:
// __________ Constructors __________
Player(const char *path) : TextureObject(path) {}
Player(const char *path, int x, int y, bool anim) : TextureObject(path, x, y, anim) {}
// __________ Getters ___________
// Player pixel coordinates
int PosX() { return positionX; }
int PosY() { return positionY; }
bool IsInAir() { return in_air; }
// __________ Player Movement __________
// Move player pixel coordinates around the map
void DeltaCoords(int dx, int dy) { SetCoords(positionX + dx, positionY + dy); }
void DeltaX(int dx) { SetCoords(positionX + dx, positionY); }
void DeltaY(int dy) { SetCoords(positionX, positionY + dy); }
}
All libraries are linked through relative pathing. Therefore, you don't need to install anything.
- Make sure you have Windows SDK installed
- Clone it
- Ctrl + F5 (run)
Menu GUI interface (SDL based/ 32bit)
- Start Menu-> Visual Studio 2017 -> Developer CMD
- Follow the tutorial
- Last command line should be: lib /def:sqlite3.def /out:sqlite3.lib /machine:X64