File
Examples
DodgerBounceSnakeShooterParticlesQuest RPGShowcasePlatform
Debug
Program Editor - untitled.bch
Ln 1, Col 1
Game Screen (320x240)
Barchan - indent 2 spaces, # = comment
let x be 5 set x to 1 change x by 2
make hero: x=10 y=20 w=16 h=16
add 5 to list let list be [1,2] count(list)
remove x from list clear list cull(list) pick(list)
Logic if/else if/else while repeat 5 times:
for i from 1 to 10: for each t in list:
to add a, b: then give a + b; call: do name(1,2) or use in a formula
every 2 seconds: on click: on tick: on start:
on press space: on hold left: on release space: key("left")
Draw screen is 320x240
paint c box x,y,w,h,c circle x,y,r,c oval x,y,rx,ry,c
ring x,y,r,c,w line x1,y1,x2,y2,c,w pixel x,y,c triangle x1,y1,x2,y2,x3,y3,c
write "hi", x, y, c, size size 1-6 (default 2); x can be "center"
draw "sprite", x, y, scale, angle - made in Sprites tab; negative scale flips
alpha 0.5 fades what you draw next (1 = solid) shake 8 fps 60
Games scene "play": block runs only in that scene; go "over" switches; game.scene game.t (frames in scene)
after 2 seconds: runs once
Maps let m be tilemap(["###","#.#"], 16) drawmap m, {"#":"gray",".":"green"} (colors or sprite names)
solid(m,x,y,w,h) wall test (extra arg = wall chars) tile(m,tx,ty) settile(m,tx,ty,"#")
camera x, y scrolls the world; camera 0, 0 to draw the HUD
RPG textbox "Name", "text", chars (chars = typewriter) bar x,y,w,h,value,max,c
roll(2,6) dice chance(25) % move(o,tx,ty,speed) sortby(list,"y")
drawframe "sheet",x,y,fw,fh,n,scale sprite sheets tune "c4 e4 g4 -", 120, yes music (yes = loop)
Menus screen 640, 360 sets the game size (default 320x240)
if button("Go", x, y, w, h): draws a button; true when clicked
panel x,y,w,h stone panel wrap(text, width, size) list of lines over(x,y,w,h) mouse.click leave exits a function
Blueprints define enemy: then indented hp = 3 props, on create: on tick: on destroy: to hurt n: (use self); define boss like enemy:
spawn enemy: x=10 y=20 all("enemy") do kill(self) hits(self,"enemy") list of touching; instances tick after your main tick
Dictionaries let d be {"hp": 5} d["hp"] set d["x"] to 1 keys(d) values(d) has(d,"k") size(d) remove "k" from d; lists/dicts may span lines
Physics physics o, map uses o.vx o.vy, o.gravity (.4) o.bounce o.friction; sets o.onGround; jump(o, 7); map chars = one-way, / \ slopes
Maps paint in the Maps tab, then let m be loadmap("name") drawmap m drawfront m zone(m,x,y,w,h) trigger char
Anim make frames in Sprites, add a Tag, then play "hero","walk",x,y,scale
FX emit "smoke",x,y,n (smoke sparks fire dust magic) weather "rain" (snow, none) darkness 0.6 light x,y,r,"#ffd080" each frame
Music tune ["c4 e4 g4 -", {"wave":"triangle","notes":"c3 - g3 -"}, {"wave":"drums","notes":"k - s -"}], 120, yes (c4:2 = longer)
Debug pause halts the game and opens Vars; Step runs one frame; Vars shows variables + objects
Files + tab adds a file (all files run together); double-click renames; Save packs many files, maps and sprite animations into .bchwrap
Sound beep hz, ms, "sine" sfx "coin" (coin jump hit boom power laser lose)
Other say stop time() remember "k", v recall("k", default)
mouse.x mouse.y mouse.down · rgb(r,g,b) upper lower str num
random(a,b) hit(a,b) dist(x1,y1,x2,y2) angle(x1,y1,x2,y2) lerp(a,b,t) clamp abs floor ceil round sign sqrt log sin cos atan2 min max pow pi
Ctrl+Enter runs. Ctrl+S saves. Ctrl+/ comments lines. Tab / Shift+Tab indents. Export makes a standalone game page. Errors jump to the bad line.