xxxxxxxxxx
var circle_x
var circle_y
var r
var g
var b
var spongeboboutro
function preload(){
spongeboboutro = loadSound('spongeboboutro.mp3')
} // end preLoad
function setup() {
createCanvas(600, 600);
spongeboboutro.play()
// CIRCLE
circle_x = 100
circle_y = 100
r = random(255)
g = random(255)
b = random(255)
} // end setup
function draw() {
background(0);
fill(r,b,g)
circle(circle_x,circle_y,50)
} // end draw
function keyTyped(){
// play ("a")
if(key == "a"){
if(spongeboboutro.isPlaying()){
spongeboboutro.stop}
} // end if
else{
spongeboboutro.play()
}// end else
}// end keyTyped
function keyPressed(){
// a
if(key=='a'){
circle_x-= 30
} // end if statement
// d
if(key=='d'){
circle_x+= 30
} // end if statement
// w
if(key =='w'){
circle_y -= 30
} // end if statement
// s
if(key == 's'){
circle_y+= 30
}// end if statement
} // end keyPressed
function mousePressed(){
r = random(100,255)
g = random(100,255)
b = random(100, 255)
}// end mousePressed