Level namespace is your primary interface to everything happening inside a running level. Every variable and function documented here is accessed directly as a field on the global Level table — for example, Level.keysCount or Level.completeLevel(). All variables are read-only unless explicitly noted otherwise.
Campaign Info
These variables describe which campaign, episode, and level is currently running.Level State
These variables expose the current structural state of the level.Time & Timer
Scoring
Lives
Special States
Entity Accessors
These functions return entities from the level. Functions ending withIterator return a lazy iterator for for loops; their counterparts return a plain Lua table.
Iterators
Tables
Single entity lookups
Level Control Functions
completeLevel
Marks the level as successfully completed and advances to the next level.
loseLevel
Triggers the lose-level state with a specified cause.
restartLevel
Restarts the current level from the beginning.
Time Functions
Scoring & Lives Functions
Effect Functions
Dark mode
Sleeping pill
Checkpoints
Fruit Helpers
Utility
delayAction
Schedules a Lua function to run after delayTime seconds.