This guide is in the program too!
T² QUICK GUIDE
═════════════════════════════════════════════
Blocks open with a keyword and close with end. Indentation is just for looks (Format Document fixes it).
OUTPUT / INPUT
say "Hello", name print things
set name = ask "Your name?" pop-up question (text)
set n = ask_number "How many?" pop-up question (number)
popup "Message" confirm "Sure?" (yes/no)
VARIABLES
set x = 5 let y to 10 x = 5 also works
change x by 3 increase x decrease x by 2
add 4 to list remove 4 from list
yes / no / nothing = True / False / None
CHOICES
if x > 3 [then] ... else if x > 1 ... else ... end
and or not == != < > <= >=
LOOPS
repeat 5 times ... end repeat forever ... end
repeat i from 1 to 10 [step 2] repeat while x < 5
for each item in list ... end stop (break) skip (continue)
FUNCTIONS & CLASSES
define greet name, age ... return value ... end
class Dog ... end (full Python inside)
ERRORS
try ... catch e ... finally ... end
FILES & MODULES
use math use random as r from math use sqrt
include "helpers" run another script of the project
read_file(p) write_file(p, t) append_file(p, t) file_exists(p) fetch(url)
HELPERS
wait 2 random_number(1, 6) pick(list) shuffle(list) now() today() length(x) exit
ASSETS (each project has an assets folder: assets/images, assets/sounds, assets/music ...)
Use the ASSETS panel in the sidebar (+ Import) - names need no folder or extension.
board.image(x, y, "ship") draw assets/images/ship.png (centred on x, y)
board.image(x, y, "ship", 4) 4x bigger, pixels stay crisp
board.image(x, y, "ship", 4, frame, 3) one cell (frame 0-2) of a 3-frame sprite strip
board.set_image(item, "ship2") swap a picture (animation) flip=yes mirrors it
play "laser" play("laser", 0.5) sound effect (volume 0-1); many can overlap
load_sounds() optional: load all sounds first so nothing lags
play_music("song") stop_music() stop_sounds() looping background music (mp3 / wav)
image_size("ship") list_assets("images") asset_path("level1", "data")
Images: PNG or GIF. Sounds: WAV (best), MP3, WMA. Sound needs Windows.
EDITORS (ASSETS panel: 🎨 Sprite and 🔊 SFX, or the Assets menu)
Pixel editor: pencil, eraser, fill, line, rectangle, ellipse, picker; mirror drawing, brush sizes, palette,
layers, undo/redo, animation frames with onion skin + live preview. Saves a PNG into assets/images (frames sit side
by side in one strip - use board.image(x, y, "name", 1, frame, frame_count)).
Layers: + new, ⧉ copy, 🗑 delete, ▲▼ reorder, ⤓ Merge into the layer below; click 👁 to hide, double-click to rename.
Layers are shared by all frames. Hidden layers aren't in the saved PNG, but the layers are kept inside it, so you
can reopen the sprite and keep editing them. PageUp / PageDown pick the layer above / below.
Keys: B E G L R O I tools, X swap colours, [ ] brush size, , . previous/next frame, Ctrl+arrows nudge.
Double-click an image in the ASSETS panel to edit it.
Sound editor (sfxr): generate pickup / laser / explosion / powerup / hit / jump / blip sounds, randomize, mutate,
or tweak every slider. Saves a WAV into assets/sounds with the settings inside it, so you can
right-click it > Edit in sound editor later.
WINDOWS (a window only appears when your script asks for one)
set win = window("Title", 400, 300)
win.label("text", size) win.button("text", function) win.entry() win.slider(0, 100)
win.checkbox("text") win.canvas(w, h, "#000") win.space(20) win.color = "#123456"
win.every(ms, function) win.on_key(function) win.on_key_up(function) win.show()
held input: key_down("left") key_down("space") key_down("shift") mouse_down() (also win.key_down / win.mouse_down)
fullscreen: press F11 in any window, or win.fullscreen() / win.fullscreen(yes) / win.is_fullscreen
canvases scale to fit the window (black bars keep the shape). win.scale_to_fit = no turns that off,
win.integer_scale = yes keeps pixel art crisp (whole-number zoom only; automatic once you draw images)
canvas: rect circle line text move delete clear color position touching on_click on_drag mouse
label.text entry.value slider.value checkbox.value
PYTHON INSIDE T²
Anything T² doesn't recognise is passed straight to Python, so every Python library
and feature works. Multi-line strings (triple quotes) work too.
FILE TYPES
.tsq script .tsr script that runs the moment it's opened .tsb multi-script bundle
QUICK ADD
Select some code, right-click, choose ⚡ Quick Add to wrap it in a loop, if/else, try/catch or function,
or turn it into say / variable / list-add. (Also under Edit › Quick Add and in the command palette.)
TABS
Each project only shows its own tabs. Click ✕ (or middle-click, or Ctrl+W) to close a tab.
SHORTCUTS
F5 run file F6 run project Shift+F5 stop Ctrl+S save Ctrl+Shift+S save as
Ctrl+O open Ctrl+N new file Ctrl+Shift+N new project Ctrl+W close tab
Ctrl+F find/replace Ctrl+/ comment Ctrl+Shift+F format Ctrl+Shift+P command palette
Ctrl +/- or Ctrl+wheel zoom F11 fullscreen (Esc leaves) Ctrl+B hide / show sidebar