Skip to content

productive/game

 
 

Repository files navigation

WHAT IS THE CURRENT SHORT TERM GOAL: LUA integration for scenes and GameObjects, providing lifecycle hooks.
BUGS: Pretty sure there is a leak somewhere in the event handling, check it out.
TASK QUEUE: GLSL Shader support. Write a defragmenting page allocator to rid the codebase of std::new.

What is this project?

1. A lightweight, simple framework for gamejamming and indie 2D and 3D PC games.
2. Well organised and easy to read and understand.
3. Focused on making games easier to develop by using only in-engine tools.

What isn't this project?

1. A commercial or otherwise noteworthy game "engine".
2. Jam packed with the latest rendering techniques.
3. Specialised for any one particular type of game.

Technology Choices:

* libSDL for IO
* OpenGL for rendering
* LUA for scripting
* irrKlang for Sound
* TGA, OBJ and ANM file formats
* For everything else, the choice is Roll-Your-Own because dependancies suck and this is a coding for fun and learning project.

Organisation:

core/     
Code for atomic data structures, collections and containers. Anything that exists here does not need to include any other file in the solution, generally. Most of the code here should be declaritive, not procedural (very little cpp expected).

engine/
Functions required by the engine to perform the basic tasks of running a game - processing inputs, rendering things to the screen, loading resources and the like. Nothing feature specific to reside here.

./
Game specific functionality. Code here is glue that links engine features to perform compound tasks like controlling an AI agent or responding to player actions.

Style:

#include <cstandardthings>

#include <librarythings>

#include "core/coreFoo.h"
#include "core/coreBar.h"
#include "core/coreBaz.h"

#include "engine/engineThing.h"
#include "engine/anotherThing.h"

#include "thisFilesHeader.h"

void Style::WhatIsYourStyle(bool a_tellMeNow, const char *a_tellMeHow_OUT)
{
  // Here we are explaining why this is happening, verbose comments
  // are super nice. Comment lines don't cost anything and we are learning.
  if (a_tellMeNow)
  {
    sprintf(a_tellMeHow_OUT, "%s", "LiekThis");
  }

  // We update our cached style version here
  m_styleUpdated &= a_tellMeNow;
}
  
For variable names, here is a neat and easy trick that grants instant identification of a variable's intention and scope.
m_variable for a member 
a_variable for an argument
s_variable for a static and usually const data member
variable for locally scoped.

To be explicit about mutable arguments passed into a method by reference, the following convention is useful
a_variable_OUT

Other Notes:

In 3D the Z axis is UP
In 2D the middle of the screen is 0,0, top left of the screen is -1,1. 2D quads are drawn top left to bottom right.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 62.1%
  • C++ 32.7%
  • Objective-C 5.2%