README.md

December 6, 2024 ยท View on GitHub

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


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

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

LanguageProject
NimCompilerNim-Platformer / sdl3_nim
LuaJITScriptLuaJIT-Platformer
NeluaCompilerNeLua-Platformer

Other project


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