A work in progress tutorial series for developing a cross platform game engine from scratch. The source code for all tutorials will be maintained in this repo and can be accessed here.
- 1.0 Embedding Python
- 2.0 Game Loop & SDL
- 3.0 OpenGL Rendering
- 4.0 Implementing Audio
- 5.0 Input Management
- 6.0 Entity Component System
- 7.0 Serializing With JSON
- 8.0 Animations
- 9.0 Collisions
Note: Chapters are a work in progress and subject to change
- Sprite Rendering
- Font Rendering
- Keyboard, mouse, and gamepad input
- Entity Component System
- Scene Management
- Json Serialization of project properties and scene data
- Python Scripting
- Camera System
- Animation
- Collisions
- Python Engine API
- Example Games
Make is used to build the source code examples. To build the code for a section, change directory to that folder's section (which contains a Makefile) and run the build
target with make build
. Below is more information about targets defined in the Makefiles.
Name | Description |
---|---|
build | Compile and link the application. |
run | Will run the application. |
clean | Deletes the executable and .o files. |
format | Will format the source code via astyle. |
debug-build | Same as build but adds debug symbols. |
There is also a top level Makefile that can be used to run make targets for each section's source. To run, define a SECTION
parameter when executing make with the following syntax: SECTION=[PART].[CHAPTER].[SECTION]
.
# Build Chapter 1 Section 0 (Hello Python)
make build SECTION=1.1.0
# Run Chapter 1 Section 1 (Hello Python)
make run SECTION=1.1.0
# Format Chapter 5 Section 1 (Input Management)
make format SECTION=1.5.0
The makefiles for each section uses the following environment variables for building:
Name | Description |
---|---|
PYTHON_INCLUDE | Include folder of the python installation. |
PYTHON_LIBS | Python lib folder containing .a files. |
SDL2_INCLUDE | Include folder for SDL2. |
SDL2_LIBS | SDL2 lib folder containing .a files. |
FREETYPE_INCLUDE | Freetype include folder. |
FREETYPE_LIBS | Freetype lib folder containing .a files. |