PIXELFALLS
  • Docs
  • Hardware
  • News
  • Roadmap
  • Pricing
  • Schools
SchoolsHardwareTerms of ServicePrivacy Policy

© 2026 PIXELFALLS

Documentation

Debug & console

These globals are for logging and diagnostics while your game runs. They are implemented in the engine and are always available in Lua. The Lua debug library is not available to cart scripts. Breakpoints and stepping are an IDE tool; see Debugger.

print(...)

Sends output to the play console (in the IDE, the in-game console panel). Pass any number of arguments; they are converted with Lua’s usual tostring rules (including __tostring) and separated by a tab, matching standard Lua print. In the console, a newline (\n in a Lua string) starts a new line, and a tab (\t) is shown as four spaces.

print("score", score)
print(player.x, player.y)
print("line one\nline two")
print("name\tscore")

Use this for everyday debugging. It is the main tool you need during development.

printError(msg)

Takes a single string and routes it to the host as an error line. On the web build, the IDE can forward this to the browser developer console (via Emscripten Module hooks), so it is easier to spot than a normal print when something went wrong but execution continues.

if not resource then
  printError("missing resource: " .. tostring(path))
end
Functions

print

Log values to the play console (web: in-game console). Multiple arguments are joined with a tab and formatted like standard Lua print (including __tostring). A newline in the text (`\n` in a Lua string) starts a new line in that log entry. A tab (`\t`) is shown as four spaces.

  • print(...) -> void

Parameters

  • ... — Values to print (tabs between them).

Returns

  • void — No return value.

Examples

-- Show a message in the play console.
print("score", 10)

printError

Report an error string to the IDE or browser console. Use for non-fatal issues you want visible outside the normal play console.

  • printError(msg) -> void

Parameters

  • msg — Message text.

Returns

  • void — No return value.

Examples

-- Report a problem outside the normal play console.
printError("missing sprite")