Tutorial: Writing a 2D Platform Game in NeLua language with SDL2.
This repository has been inherited from Nim-Platformer and LuaJIT-Platformer project.
- Document
English: https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/
Japanese: https://postd.cc/writing-a-2d-platform-game-in-nim-with-sdl2/
Skin database https://ddnet.org/skins
Windows10 or later
-
Install MSys2/MinGW
-
Install NeLua
-
Install SDL2 libraries
pacman -S mingw-w64-x86_64-{SDL2,SDL2_image,SDL2_ttf}
or if you use
ucrt
libraries,pacman -S mingw-w64-ucrt-x86_64-{SDL2,SDL2_image,SDL2_ttf}
-
Other tools
pacman -S make
Git command installed
-
Clone from git
git clone https://github.com/dinau/nelua-platformer
-
Build and run
cd nelua-paltformer cd tutorial make 8r # Build and run platformer_part8.nelua
or enable runtime checking and debug build and run
pwd tutorial nelua paltformer_part8.nelua
-
Only build a source
pwd tutorial make 8 # Build platformer_part8.nelua
-
Build all tutorial sources
pwd tutorial make build # Build from part1 to part8 sources
Key | Function |
---|---|
Up,Space, J, K | Jump |
Left, A, H | Left |
Right, D, L | Right |
R | Restart |
Q | Quit |
platformer_part1.nelua
platformer_part2.nelua
platformer_part3.nelua
platformer_part4.nelua
platformer_part5.nelua : From here it can move the item with key operation.
platformer_part6.nelua
platformer_part7.nelua
platformer_part8.nelua
platformer_part9.nelua : In progress. TODO
These header files
sdl2.nelua
sdl2_image.nelua
sdl2_ttf.nelua
have thankfully been just copied form nelua-decl libraries project.
- Nelua 0.2.0-dev
- gcc.exe (Rev2, Built by MSYS2 project) 14.2.0
- SDL2 v2.30.9
- SDL2_image v2.8.2
- SDL2_ttf v2.22.0
- SDL2.dll https://github.com/libsdl-org/SDL/releases/
- SDL2_image.dll https://github.com/libsdl-org/SDL_image/releases/
- SDL2_ttf.dll https://github.com/libsdl-org/SDL_ttf/releases/
- LuaJIT-SDL2 https://github.com/sonoro1234/LuaJIT-SDL2
Language | Project | |
---|---|---|
Nim | Compiler | Nim-Platformer / sdl3_nim |
LuaJIT | Script | LuaJIT-Platformer |
Nelua | Compiler | NeLua-Platformer |
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 |