README.md

November 27, 2025 ยท View on GitHub

Zig-Platformer


Tutorial: Writing a 2D Platform Game in Zig language with SDL2 / SDL3 / SDL_ttf.

This repository has been inherited from Nim-Platformer, LuaJIT-Platformer and Nelua-Platformer project.

Skin database https://ddnet.org/skins

alt

Prerequisites

Versions


zig-0.15.2
SDL2: 2.32.10
SDL2: 3.2.26
SDL_ttf: 3.2.2

Support OS


WindowsLinuxMacOS
SDL2YESYESYES
SDL3YESYES?
  • Windows11

    • MSys2/MinGW basic commands (make, rm, cp, strip ...)
  • Linux: Debian families

    $ sudo apt install libopengl-dev libgl1-mesa-dev
    $ sudo apt install libsdl2-dev libsdl2-ttf-dev
    

    See SDL3 intallation on Linux

  • MacOS: P.R.

Build and run


git clone https://github.com/dinau/zig-platformer
cd zig-platformer/tutorial

For instance,

cd sdl3/part3
make run       

or

cd sdl3/part3
zig build --release=fast
cd zig-out/bin 
part3.exe

You can build SDL2 tutorials same as SDL3.

Key operation


KeyFunction
Up,Space, J, KJump
Left, A, HLeft
Right, D, LRight
RRestart
QQuit, Esc

Tutorial sources


Part1Part2Part3
(Showing item)
Part4Part5
(Moving item)
Part6Part7Part8
(Almost completed)
Part9
SDL2part1part2part3part4part5part6part7part8-
SDL3part1part2part3part4part5part6part7part8-

SDL librarys


https://github.com/libsdl-org/SDL/releases

Other SDL game tutorial platfromer project


ald

LanguageProject
NimCompilerNim-Platformer / sdl3_nim
LuaJITScriptLuaJIT-Platformer
NeluaCompilerNeLua-Platformer
ZigCompilerZig-Platformer
C3CompilerC3-Platformer WIP
RubyScriptRuby-Platformer WIP

Other project


LanguageProject
NimCompilerImGuin, Nimgl_test, Nim_implot
LuaScriptLuaJITImGui
Zig, C lang.CompilerDear_Bindings_Build
ZigCompilerImGuinZ
NeLuaCompilerNeLuaImGui
PythonScriptDearPyGui for 32bit WindowsOS Binary
RubyScriptIgRuby-Examples