Stop
Continue
Go
/* Random Path Example In this example, an object starts at the center of the canvas and random forces are applied to it in the form of random acceleration. ax is between 0 and 1, so it moves left. ay varies between -1 and 1. */ function setup(){ //start in middle of screen translate(width/2,height/2); } function draw(){ var x,y; //coordinates var vx,vy; //velocity var angle; //angle/direction var ax,ay; //acceleration var i; //index //start at center x=0; y=0; //0 velocity vx=0; vy=0; //0 acceleration ax=0; ay=0; //draw 20 steps of path for (i=0;i<20;i++){ line(x,y,x+vx,y+vy); //update position x=x+vx; y=y+vy; //update acceleration ax=random(); ay=2*(random()-0.5); //update velocity vx=vx+ax; vy=vy+ay; } }
default
3024-day
3024-night
ambiance
base16-dark
base16-light
blackboard
cobalt
eclipse
elegant
erlang-dark
lesser-dark
mbo
mdn-like
midnight
monokai
neat
night
paraiso-dark
paraiso-light
pastel-on-dark
rubyblue
solarized dark
solarized light
the-matrix
tomorrow-night-eighties
twilight
vibrant-ink
xq-dark
xq-light