Skip to content

reference · the differences

Different from code.org·

Made games on code.org before? Everything is the same engine, except these.

code.org spawn
the screen 400 × 400 600 × 600. World.width and World.height say so.
sprite size drawn at 1 pixel art is drawn a whole number of times its size, so it stays crisp: 16 px at 4×, 24 at 3×, 32 at 2×
the middle of the screen (200, 200) (300, 300)
sounds uploaded in the Animation tab made, recorded, uploaded, or written as a song or a beat in the sound room; playSound("hit.mp3") by the slot's name
the music's volume none the Volume slider under the music row in the sound room
a sound's volume from the code none setVolume(0.5): every sound played after it plays at half, until the next setVolume
a sound's pitch from the code none setPitch(2): every short sound played after it plays an octave up (0.5 down, Math.pow(2, n / 12) for n steps of the scale), until the next setPitch. Music loops keep theirs.
a sound exactly on time none soundTime() reads the sound clock and turns on exact timing: short sounds can then play over themselves, and setSoundTime(t) starts the next ones exactly at t.
facing the way it walks mirrorX(-1) beside every left key, mirrorX(1) beside every right one faceMoving(player) once, where the sprite is made
art the Animation tab the art room; a sprite with no art shows as a plain square until its name has art
the background background("…") the same; the background color is a knob, and an art pack in the art room picks one
a background that moves on its own none scrollBackground(3): the picture slides 3 pixels a frame even when the camera stands still; a negative speed goes the other way, scrollBackground(0) stops it
a background picture per level none setBackground("level2"): from then on the art named level2 fills the screen behind everything. setBackground("backdrop") goes back to the game's own, setBackground("") to the plain color. Each name gets a background card in the art room
a mouse that turns a first-person view none lockMouse() on a click hides the pointer and hands every move to the game; while mouseIsLocked(), mouseMovedX and mouseMovedY are how far it moved since the last frame, with no screen edge to stop it. ESC or unlockMouse() gives the pointer back
title-screen music none the Menu music row in the sound room: it loops on the title screen and stops when play starts, where the game's music begins
where it goes Share on code.org Share my game puts it in the lobby on Spawn Point. A spawn game does not go back to code.org
versions copies a project keeps earlier copies of one game

Everything else is the same engine. If a function is on these pages, it works.