Skip to content

reference · functions

Functions·

Every block in the World, Drawing, Control, Math, Variables and Functions drawers, one page each, in the order the code room shows them. Generated from the same block table the code room's blocks come from, so a block is on this page exactly when it is in the code room.

block drawer
function draw() {} World
drawSprites World
playSound World
stopSound World
playSpeech World
keyDown World
keyWentDown World
keyWentUp World
mouseDidMove World
mouseDown World
mouseIsOver World
mousePressedOver World
mouseWentDown World
mouseWentUp World
showMobileControls World
World.allSprites World
World.width World
World.height World
World.mouseX World
World.mouseY World
World.frameRate World
World.frameCount World
World.seconds World
camera.on World
camera.off World
camera.isActive World
camera.mouseX World
camera.mouseY World
camera.x World
camera.y World
camera.zoom World
// Comment World
background Drawing
fill Drawing
noFill Drawing
stroke Drawing
noStroke Drawing
strokeWeight Drawing
rgb Drawing
rect Drawing
ellipse Drawing
text Drawing
textAlign Drawing
textFont Drawing
textSize Drawing
arc Drawing
line Drawing
point Drawing
regularPolygon Drawing
shape Drawing
triangle Drawing
// Comment Drawing
for (var i = 0; i < 4; i++) { Control
while (___) { Control
if (___) { Control
if (___) { Control
setTimeout Control
clearTimeout Control
setInterval Control
clearInterval Control
timedLoop Control
stopTimedLoop Control
// Comment Control
___ + ___ Math
___ - ___ Math
___ * ___ Math
___ / ___ Math
___ % ___ Math
___ == ___ Math
___ != ___ Math
___ > ___ Math
___ >= ___ Math
___ < ___ Math
___ <= ___ Math
___ && ___ Math
___ || ___ Math
!___ Math
randomNumber(1, 10) Math
Math.round(___) Math
Math.abs(___) Math
Math.max(___) Math
Math.min(___) Math
Math.random() Math
Math.pow(___, ___) Math
Math.sqrt(___) Math
___++ Math
___-- Math
sin Math
cos Math
tan Math
asin Math
acos Math
atan Math
atan2 Math
degrees Math
radians Math
angleMode Math
random Math
randomGaussian Math
randomSeed Math
abs Math
ceil Math
constrain Math
dist Math
exp Math
floor Math
lerp Math
log Math
mag Math
map Math
max Math
min Math
norm Math
pow Math
round Math
sq Math
sqrt Math
// Comment Math
var x = ___; Variables
var x; Variables
x = ___; Variables
var x = [1, 2, 3, 4]; Variables
var x = prompt("Enter a value"); Variables
var x = promptNum("Enter a value"); Variables
console.log Variables
console.clear Variables
var str = "Hello World"; Variables
sprite.substring Variables
sprite.indexOf Variables
sprite.includes Variables
sprite.length Variables
sprite.toUpperCase Variables
sprite.toLowerCase Variables
var list = [1, 2, 3]; Variables
var list = ["a", "b", "d"]; Variables
list[0] Variables
list.length Variables
sprite.join Variables
insertItem Variables
appendItem Variables
removeItem Variables
// Comment Variables
function myFunction() { Functions
function myFunction(n) { Functions
myFunction() Functions
myFunction(n) Functions
return ___; Functions
// Comment Functions