Skip to content
Josh Goebel edited this page Mar 21, 2022 · 7 revisions

BOOT

The BOOT function is called a single time when your cartridge is booted. It should be used for startup/initialization code. For scripting languages that allow code in the global scope (Lua, etc.) using BOOT is preferred rather than including source code in the global scope.

-- script: lua
function BOOT()
  -- Put your bootup code here
end

Examples in other languages

-- script: moon
export BOOT=->
  -- Put your stuff here
// script: js
function BOOT() {
  // Put your stuff here
}
// script: wren
class Game is TIC {
  construct new() {
  }
  BOOT(){
    // Put your stuff here
  }
}
;; script: fennel
(global TIC
  (fn boot []
    ;; Put your stuff here
  )
)
// script: squirrel
function BOOT() {
  // Put your stuff here
}
# script: ruby
def BOOT
  # Put your stuff here
end
Clone this wiki locally