Coding Guidelines - UbuntuJackson/UFO-Cells GitHub Wiki
Variablenames are lowercase letters and snakecase.
int text_length;
Functionnames are camelcase with capital letter first, never lowercase letter first. For example:
void RayVsRay(Ray2 _v, Ray2 _w);
Overridable function or callback should have the prefix On. For example:
virtual void OnCollision(){...}
When initializing class member variables, directly call the constructor of the object, whenever possible. Instead of writing for example: camera{Camera(this)} you write camera(this). I also wanna add that members should be initialized in definition (.cpp) and never in the headerfile (.h).
[ ! ][ CURRENTLY UNDER DEBATE ] Member variables should start with m_. (Not implemented yet)
No shortenings of variables unless it is absolutely necessary.
olc::vf2d rand_pos; // incorrect!
olc::vf2d random_position; // correct!
Tho they might become quite long, but try to find good names which summarises them well, only shorten them in worst case scenarios and add a comment.
Parameters should be prefixed with underscores. For example:
void
Camera::DrawDecal(olc::vf2d _position, olc::Decal* _decal, ...){
...
}