project 3
I was kind of stumped for an idea for this project, I had some shapes and when you moved the mouse it would change some of the colors according to the x axis and the y axis. also if you moved the arrow keys the ellipse would move, and a square would appear and then it would slowly disappear.
ar speed = 10;
function setup() {
createCanvas(900, 900);
}
function draw() {
background(mouseX, 180, mouseY, 3);
fill(180, 0, 255);
ellipse(x, 40, 80, 80);
strokeWeight(0);
fill(120, 255, 0);
quad(30, 80, 90, 120, 190, 60, 200, 350);
fill(190, 0, 130);
quad(200, 351, 260, 451, 300, 391, 200, 681);
if(keyIsPressed){
if(keyCode == LEFT_ARROW){
x--;
}
else if(keyCode == RIGHT_ARROW){
x ++;
}
triangle(600, 200, 400, 260, 800, 320);
fill(0, 90, 160, mouseX);
triangle(600, 400, 400, 260, 800, 320);
fill(160, 90, 0, mouseY);
}
}
Comments
Post a Comment