Register Cocos2d-x 3.17 Lua keyboard press and release callbacks with cc.EventListenerKeyboard, handle KeyCode values, attach the listener, and clean it up.
Lua Coroutine Cooperative Multitasking: Schedulers and Async I/O
Use Lua coroutines, yield, and resume to build a cooperative task scheduler and coordinate non-blocking network I/O without confusing concurrency with parallel execution.
Lua Debug Library Reflection: getinfo, Locals, Hooks and Sandboxing
Use Lua's debug library to inspect functions, stack frames, local variables, upvalues, coroutines, and execution hooks while understanding performance and sandbox risks.
Lua Coroutines: create, resume, yield, States and Iterators
Learn Lua coroutine creation, resume and yield value flow, status transitions, iterator patterns, main-loop ownership, and event-driven program structure.
Lua Garbage Collection: Weak Tables, Caches, Finalizers and Control
Understand Lua garbage collection through reachability, weak-key and weak-value tables, caches, finalizers, external resources, and practical collectgarbage controls.
Lua Environments Explained: _G, _ENV, Dynamic Globals and Modules
Understand Lua _G and _ENV, dynamically named globals, undeclared-variable checks, isolated module environments, and explicit environments passed to load.
Shuffle a Lua Array with Fisher-Yates: In-Place and Copy Variants
Shuffle a Lua array uniformly with the Fisher-Yates algorithm, understand its linear complexity, and choose between an in-place function and a copied result.
Object-Oriented Lua: Classes, self, Inheritance and Private State
Implement object-oriented Lua with tables, functions, metatables, self methods, constructors, inheritance, private state, callable objects, and alternative object models.
Lua Metatables and Metamethods: __index, Operators and Proxies
Customize Lua arithmetic, comparison, indexing, assignment, calls, and string conversion with metatables, __index, __newindex, and proxy-table patterns.
Lua import vs require: Standard Module Loading and Framework Helpers
Understand why require is Lua's standard cached module loader while import is usually a framework helper with project-specific path, return-value, or reload behavior.