-
-
Notifications
You must be signed in to change notification settings - Fork 492
Hello World
Josh Goebel edited this page Oct 7, 2021
·
13 revisions
Below are reference copies of the Hello World starter cartridge that can be easily generated from the TIC-80 Console using the new
command:
new lua
new fennel
new js
new wren
- etc
-- title: game title
-- author: game developer
-- desc: short description
-- script: lua
t=0
x=96
y=24
function TIC()
if btn(0) then y=y-1 end
if btn(1) then y=y+1 end
if btn(2) then x=x-1 end
if btn(3) then x=x+1 end
cls(13)
spr(1+t%60//30*2,x,y,14,3,0,0,2,2)
print("HELLO WORLD!",84,84)
t=t+1
end
// title: game title
// author: game developer
// desc: short description
// script: wren
class Game is TIC{
construct new(){
_t=0
_x=96
_y=24
}
TIC(){
if(TIC.btn(0)){
_y=_y-1
}
if(TIC.btn(1)){
_y=_y+1
}
if(TIC.btn(2)){
_x=_x-1
}
if(TIC.btn(3)){
_x=_x+1
}
TIC.cls(13)
TIC.spr(1+((_t%60)/30|0)*2,_x,_y,14,3,0,0,2,2)
TIC.print("HELLO WORLD!",84,84)
_t=_t+1
}
}
;; title: game title
;; author: game developer
;; desc: short description
;; script: fennel
(var t 0)
(var x 96)
(var y 24)
(global TIC
(fn tic []
(when (btn 0) (set y (- y 1)))
(when (btn 1) (set y (+ y 1)))
(when (btn 2) (set x (- x 1)))
(when (btn 3) (set x (+ x 1)))
(cls 0)
(spr (+ 1 (* (// (% t 60) 30) 2))
x y 14 3 0 0 2 2)
(print "HELLO WORLD!" 84 84)
(set t (+ t 1))))
// title: game title
// author: game developer
// desc: short description
// script: js
var t=0
var x=96
var y=24
function TIC()
{
if(btn(0))y--
if(btn(1))y++
if(btn(2))x--
if(btn(3))x++
cls(13)
spr(1+((t%60)/30|0)*2,x,y,14,3,0,0,2,2)
print("HELLO WORLD!",84,84)
t++
}
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)