Skip to content
Hallucino edited this page Jan 26, 2018 · 23 revisions

Welcome to the Unicorn wiki!

It is fairly easy to create a simple game with Unicorn Console.

You could create directly a UNI empty file with at least the section code ("__python__" or "__lua__" or "__javascript__"), with the 3 functions that will be called by the engine.

  • _init : Called once on startup, mainly to initialize your variables
  • _update: Called once per visible frame, mainly to get keyboard input for example
  • _draw: Called once per visible frame, mainly to draw things on the screen :)

With Python:

unicorn / python cartridge
version 1
__python__

def _init():
  pass

def _update():
  pass

def _draw():
  cls()
  unicorn_print("Hello World", 40, 64, 1)

With Lua:

function _init()
end

function _update()
end

function _draw()
  cls()
  print("Hello World", 40, 64, 1)
end

With javascript:

function _init() {
}

function _update() {
}

function _draw() {
}

You can test it with with the devkit:

./target/release/uc-devkit -s helloworld.uni
Clone this wiki locally