🌙 Lua Scripting for Game Engines: Sub-Curriculum Index
Welcome to the Lua Scripting for Game Engines curriculum. This track covers Lua from core syntax and metatable-based object orientation to C++ virtual stack embedding, Love2D game development, and LuaJIT FFI memory optimization.
Every guide in this series strictly follows a two-part learning format:
- ⚡ Quick Dive: Syntax cheat sheets, metamethod tables, and code one-liners.
- 📖 Extended Guide: Complete runnable Lua/C++ scripts, prototype inheritance patterns, and zero-allocation 60 FPS optimizations.
📚 Curriculum Roadmap
| # | Guide | Primary Topics Covered |
|---|---|---|
| 01 | Lua Language Fundamentals & Tables | Dynamic typing, 1-based indexing, tables as universal data structures, multiple return values, closures, and coroutines. |
| 02 | Metatables & OOP Patterns | Metamethods (__index, __newindex, __gc), prototype inheritance, operator overloading, and class instantiation. |
| 03 | Embedding Lua in C & C++ | The Lua C virtual stack API, pushing/popping types, registering C callbacks, and running external Lua scripts. |
| 04 | Love2D Game Framework Architecture | Love2D lifecycle callbacks (load, update, draw), canvas render targets, input handling, and SpriteBatch draw call optimization. |
| 05 | LuaJIT & Performance Optimization | LuaJIT trace compiler, FFI C-struct bindings, table allocation reuse, and eliminating GC pauses in 60 FPS loops. |