Lua¶
Gameplay in Lucky & Pozzo is written in Lua. These pages document every namespace and function exposed to scripts, with exact signatures, return shapes, defaults, and gotchas.
- Entity - create, destroy, find, name.
- Transform - position, rotation, draw layer.
- Component - sprites, shapes, text, colliders, opacity, hierarchy, connections, audio, scripts.
- Input & Controller - keyboard, mouse, keybinds, actions.
- Time - timing.
- Scene - scene switching.
- Log - logging.
- Layers - collision layer names and masks.
- Audio - global sound and music.
- Net - multiplayer setup, messaging, replication, RPCs.
Conventions common to all pages:
Entityhandles are plain numbers in Lua.- Most
Component.*functions returnboolsuccess (falseon missing component or dead entity). - Functions taking
sol::optionalarguments omit them asnil. Transform.getPositionreturns a fresh table{x, y, z}.Component.getSpritereturns the literal string"sprite"if a sprite exists, elsenil; usegetSpriteInfofor data.log/print:print(...)converts each vararg to a string, joins with tabs, and logs vialog_info. Non-string args throw.Time.deltaTime()is a fallback constant1/60; prefer thedtpassed toonUpdate.Scene.loadis ignored on clients in multiplayer (the server drives scene changes) and errors if noSceneManager.Component.has/remove/entitiesWithaccept friendly alias names only:Position,Rotation,Sprite,Shape,Text,Name,Collider,Opacity,Parent,AudioSource.
See also: Engine → Lua scripting, Plugins → Lua plugins.