Skip to content

loftafi/zig-platformer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig-Platformer


alt alt
alt alt

Now work in progress.

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

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

Skin database https://ddnet.org/skins

Prerequisites

Zig version


Support OS


  • Windows10 or later

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

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

Build and run


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

For instance,

cd part3
make run       

or

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

Key operation


Key Function
Up,Space, J, K Jump
Left, A, H Left
Right, D, L Right
R Restart
Q Quit

Tutorial sources


platformer_part1
platformer_part2
platformer_part3
platformer_part4
platformer_part5 : From here it can move the item with key operation.
platformer_part6
platformer_part7
[platformer_part8]

Other SDL game tutorial platfromer project


ald

Language Project
Nim Compiler Nim-Platformer / sdl3_nim
LuaJIT Script LuaJIT-Platformer
Nelua Compiler NeLua-Platformer
Zig Compiler Zig-Platformer WIP
C3 Compiler C3-Platformer WIP

Other project


Language Project
Nim Compiler ImGuin, Nimgl_test, Nim_implot
Lua Script LuaJITImGui
Zig, C lang. Compiler Dear_Bindings_Build
Zig Compiler ImGuinZ
NeLua Compiler NeLuaImGui
Python Script DearPyGui for 32bit WindowsOS Binary

About

Writing a 2D Platform Game in Zig language with SDL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 90.4%
  • C++ 7.6%
  • Zig 1.7%
  • Other 0.3%