Describe what you want, type it, it runs. Three steps, simplest first.
1 · FIRST 5 MINUTES — tap a starter, then press ▶ RUN
2 · MAKE YOUR FIRST GAME
Open a game from the β games menu and tweak its code, or tap + New Game for a blank start.
Step-by-step lessons & recipes: codeonline.io/learn.
WHEN IT DOESN’T WORK
• Keys do nothing? Click/tap the screen once so it can hear the keyboard.
• Blank screen? Make sure you clear screen ... and draw inside to draw.
• A line ignored? Check spelling/lowercase, and that nested lines are indented.
• A red message under the editor names the line — fix that line.
3 · ALL COMMANDS
MOVE & DRAW move player with arrows draw sprite "hero" at x, y draw circle at 64, 64 size 20 in red draw rect at 10, 10 size 8, 8 in green write "score {score}" at 2, 2 in white on hud clear screen to dark blue
VALUES & MATH score is 0 add 10 to score reverse ball.dx (flip sign) x is -8 (negatives ok) if score is 100 ... if x > 10 and y < 5 ...
LOOPS & FUNCTIONS repeat 10 times ... repeat with i from 1 to 5 ... each enemy in enemies ... every 30 frames ... to NAME ... (define) NAME (call it)
SPRITES player is centered sprite {image: "hero"} coins is list of 8 sprites {image: "coin"} sprite "blob" is "<64 hex>" (or use 🧹) draw sprite player.image at player.x, player.y
SOUND play sound "pickup" (18 built in) play music "theme" · stop music define sound "zap" as square from 900 to 100 over 0.1 song "tune" at 120 bpm "#..." ... (or use ♪)
COLLISION walls are solid · coins are pickups enemies are hostile · spikes are deadly when player picks up any coin ... when player hits any enemy ...
MOTION (platformer) gravity is 0.4 jump player (upward impulse) knock player away from enemy distance 16
INPUT when "space" is pressed ... when mouse is clicked ... if key "left" ... (held) up down left right space enter
SCREENS & BUTTONS mode is "title" to screen title ... show button "play" at 40, 50 when button "play" is clicked go to play go to X · go back
THE GAME LOOP to update ... (runs each frame) to draw ... (draws each frame) run game with update and draw
Colors: black, dark blue, dark green, brown, white, red, orange, yellow, green, blue, indigo, pink, peach & more. Comments start with --. Full command reference (with runnable examples): codeonline.io/docs Made by Kevin Long (LinkedIn).
Sign in
Sign in to save your games and pick a nickname. You can keep playing without it.