Skip to content

dinau/nelua-platformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeLua-Platformer


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

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

Skin database https://ddnet.org/skins

alt

Support OS


Windows10 or later

Prerequisites


  1. Install MSys2/MinGW

  2. Install NeLua

  3. 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

Run tutorials


  1. Clone from git

    git clone  https://github.com/dinau/nelua-platformer
  2. 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  
  3. Only build a source

    pwd tutorial
    make 8       # Build platformer_part8.nelua
  4. Build all tutorial sources

    pwd tutorial
    make build   # Build from part1 to part8 sources

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.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

Other SDL2 headers for Nelua


These header files

sdl2.nelua  
sdl2_image.nelua  
sdl2_ttf.nelua   

have thankfully been just copied form nelua-decl libraries project.

Tools version


  • 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

Reference


Other SDL game tutorial platfromer project


ald

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

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

Nelua game tutorial with SDL2

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license-nim-platformer.txt

Stars

Watchers

Forks

Packages

No packages published