BITBOP

BITBOP DOCS

Make, play, and understand.

Bitbop Manual

Make pictures, beats, games, and tools with JavaScript.

Start here

Turtle.reset();
while (true) {
  Turtle.move(4);
  sleep(50);
}

Use classic JavaScript with var and function () {}. Run starts fresh. Pause holds the program in place. Step runs one highlighted statement. The Console runs snippets in Global. After Step, it uses the current local scope.

Speaking JavaScript is an outside ES5 guide. It is written for adults and experienced programmers. Use the complete API reference for studio commands.

Workspace controls

Control What it does
Format Makes Code easy to read in one edit. Undo reverses the whole change.
Wrap Shows long lines on more than one screen line. Your code does not change.
Zoom Makes Code text larger or smaller.
Examples Opens one of four finished projects. Undo Example brings back your previous project.
File Names the project, opens a .bop file, saves a copy, or makes a share link.
Panels Shows or hides parts of the studio.

Control Board

Board.buttonA.onPress(function () {
  Turtle.home();
});

Canvas, Turtle, and Paint

Canvas.onClick(function (event) {
  console.log(event.x, event.y);
});

Music

Music.play('C4', 0.25, { type: 'triangle' });
sleep(250);
Music.play('E4', 0.25);

Music provides play, stop, stopAll, setInstrument, setVolume, and setEnvelope. Notes can be names such as C4, F#3, and Db5, or MIDI numbers.

Input and timing

Debugging

console.log, console.warn, and console.error write values to the Console. Add JavaScript's debugger; statement to pause on that Code line. The Console then uses that line's local scope. You can inspect or change variables before you Step or Resume. Start typing and press Tab or Enter to complete supported globals, nested members, parameters, locals, and known object members. Function completion supplies classic-JavaScript parentheses, argument stops, and callback skeletons. Resume and Stop clear the local scope and return the Console to Global.

if (mark === 17) {
  debugger;
}

Use debugger; in Code, not in a Console snippet.

Errors highlight their source line. After Step, run a variable name in the Console to inspect its local value.