Clear Screen
cls c where c = hex color (0-F)cls 0 (black), cls 9 (blue), cls 4 (red)Update Screen - refresh display
ups goes to a bufferups = nothing displays!cls 0
rsp 10 10 1 ~~ renders to buffer ~~
rtxt 20 20 F "HI" ~~ renders to buffer ~~
ups ~~ NOW it shows on screen! ~~
Render Pixel - draw a pixel
x = X position (0-95)y = Y position (0-71)c = hex color (0-F)rp 10 20 E (yellow pixel at 10,20)Render Text - display text
x = X positiony = Y positionc = hex color (0-F)txt = text string or variablertxt 10 10 7 "HELLO" or rtxt 10 10 F fv:scoreRender Sprite - draw a sprite
x = X positiony = Y positionid = sprite number (starts from 1!)rsp 40 30 1 (renders sprite #1)Render Rectangle - draw a rectangle
x = X positiony = Y positionw = widthh = heightc = hex color (0-F)rcl 10 10 20 15 4 (red rectangle)rsp 0 0 1 ~~ sprite at top-left corner ~~
rsp 88 64 2 ~~ sprite at bottom-right (96-8=88, 72-8=64) ~~
rtxt 0 0 F "HI" ~~ text at top-left corner ~~
Clock Speed - clock rate
(16 / v) - 1v = speed valuecks 16 → (16/16)-1 = 0 seconds = MAX SPEEDcks 8 → (16/8)-1 = 1 secondcks 4 → (16/4)-1 = 3 secondscks 2 → (16/2)-1 = 7 secondsLines Per Tick - lines per clock tick
v = how many lines of code execute per clock "tick"lpt 1 → one line per tick (slow, stable)lpt 50 → 50 lines per tick (fast setup)lpt 100 → very fast executionUse high lpt for initialization, low for game loop!
Sleep - wait/pause
v = how many seconds to waitslp 0.05 → wait 0.05 secondsslp 1 → wait 1 secondslp 0 → DOES NOTHING - code continues without pauseslp 0 = no wait, does NOT interrupt executionSet Variable - set a variable
var = variable namev = value (number, text, bool, operation/comparison result)stv score 0 ~~ create/set score to 0 ~~
stv px 40 ~~ create/set px to 40 ~~
stv name "2Axis Studio" ~~ create/set name to "2Axis Studio" ~~
stv alive true ~~ create/set alive to true ~~
stv hp fv:hp - 10 ~~ set hp to hp-10 ~~
stv is_low fv:hp < 20 ~~ set is_low to comparison result (true/false) ~~
Fetch Variable - get variable value
fv:score, fv:px, fv:hp+ addition- subtraction* multiplication/ division% modstv hp fv:hp - 10
stv score fv:score + 100
stv x fv:x * 2
stv speed fv:speed / 2
stv background_x fv:background_x % 96
= equal< less than> greater thanjlif fv:score = 100 50
jlif fv:hp < 20 30
jlif fv:level > 10 40
stv is_low_hp fv:hp < 20
stv has_won fv:score = 100
jlif fv:is_low_hp 50
Jump Line If - jump to line if TRUE
bool = condition (true/false or comparison result)line = line number to jump tojlif fv:hp < 20 50 ~~ if hp < 20, jump to line 50 ~~
jlif fv:score = 100 30 ~~ if score == 100, jump to line 30 ~~
jlif true 10 ~~ always jumps to line 10 ~~
Jump Line If Not - jump to line if NOT TRUE
bool = condition (true/false or comparison result)line = line number to jump tojlifn ci:up 10 ~~ if up arrow NOT pressed, jump to 10 ~~
jlifn fv:alive 99 ~~ if alive == false, jump to 99 ~~
Jump - unconditional jump
line = line numberjmp 5 → jump to line 5stv hp 10
jlif fv:hp < 20 4
stv color 7 ~~ line 3 - continues normally ~~
~~ line 4 - EMPTY (jump target) ~~
stv color 4 ~~ line 5 - executes ~~
Label - marks the start of a label
n = label namelbl game, lbl menu, lbl game_overReturn - ends a label
n = label name to endrtn game, rtn 0Jump If to label - jumps to label if condition TRUE
bool = condition (true/false)lbl = label namejif fv:dead game_overlbl linertn linertn afterwardslbl game
cls 0 ~~ line 2 ~~
stv hp fv:hp - 1
ups
slp 0.05
jlif true 2 ~~ loop inside label(remember that it needs to end) ~~
rtn game
lbl game
cls 0 ~~ line 2 ~~
stv hp fv:hp - 1
jlif fv:hp < 0 10 ~~ ✅ exits temporarily ~~
~~ line 5 ~~
ups
slp 0.05
jlif true 2 ~~ loop ~~
rtn game ~~ line 9 - end label ~~
~~ line 10 - empty ~~
cls 4 ~~ line 11 - outside label ~~
rtxt 20 28 7 "GAME OVER!"
ups
slp 2
jlif true 2 ~~ ✅ returns to label and ends it ~~
Play Sound Wave - play a sound wave
wave = wave type: sine, triangle, square, sawtooth, noisefreq = frequency (Hz) - higher = higher pitchvol = volume (0-100)ms = duration in MILLISECONDS (not seconds!)psw sine 440 100 200 ~~ sine wave, 440Hz (A4), volume 100, 200ms ~~
psw square 880 50 500 ~~ square wave, 880Hz, volume 50, 500ms ~~
psw triangle 220 75 1000 ~~ triangle wave, 220Hz, volume 75, 1 second ~~
psw noise 110 80 400 ~~ noise, 110Hz, volume 80, 400ms ~~
Check Input - check if key is pressed
ci:en - enterci:up - up arrowci:dn - down arrowci:lf - left arrowci:rt - right arrowjlifn ci:up 10 ~~ if up NOT pressed, jump ~~
sprites list00066000006FF600006FFF60066FFFF606FFFFFF66F6F6F666FFFFFF60666666000100011101000111101110110111000100Happy coding with 2VM-6912!
Copyright © 2026 2Axis Studio. All rights reserved.