Skip to content

barkausa/Motherload

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Recommended Commenting Rules (by barkausa):

Microsoft docs

  • 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
// <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);

In class Function block commenting (example)

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); }
}

Installation

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)
There are some tutorials in case you need them:

SDL2 installation

Sqlite DOCS - tutorialspoint

Menu GUI interface (SDL based/ 32bit)

Menu GUI interface 2

SQLite3 installation (Windows):
  1. Start Menu-> Visual Studio 2017 -> Developer CMD
  2. Follow the tutorial
  3. Last command line should be: lib /def:sqlite3.def /out:sqlite3.lib /machine:X64

About

Activity Led Learning game project

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages