xxxxxxxxxx
135
//fix color in style
var y = 10;
var x = 200;
var changeX = 5;
var changeY = 5;
var redCol = 0;
var bluCol = 0;
var greCol = 0;
var altRedCol = 0;
var altGreCol = 0;
var altBluCol = 0;
//var opacity = 255;
var space;
var rot = 0;
var otherX = 0;
var otherY = 0;
var changeOtherX = 0;
var changeOtherY = 0;
var xTwo = 0;
var yTwo = 0;
var changeXTwo = 0;
var changeYTwo = 0;
function setup() {
createCanvas(400, 400);
space = loadImage("spaceimage.jpg.jpg")
}
function draw() {
background(space);
noStroke();
fill(redCol,greCol,bluCol);
ellipse(x,y,50,50);
y = y + changeY;
redCol = redCol + altRedCol;
altRedCol = altRedCol + 0.1;
x = x + changeX;
otherX = otherX + changeOtherX;
changeOtherX = changeOtherX + 0.1;
otherY = otherY + changeOtherY;
xTwo = xTwo + changeXTwo;
yTwo = yTwo + changeYTwo;
changeYTwo = changeYTwo + 0.1;
//changeOtherY = changeOtherY + 0.1;
//rot = rot + 0.1;
//otherX = otherX + 5;
//opacity = opacity - 1;
//translate(200,200);
//rotate(rot);
beginShape();
stroke(200,200,200,200,100);
fill(200,200,200,100);
vertex(otherX,otherY);
vertex((otherX-10),(otherY+40));
vertex((otherX+20),(otherY+20));
vertex((otherX-20),(otherY+20));
vertex((otherX+10),(otherY+40));
endShape(CLOSE);
beginShape();
stroke(200,200,200,200,100);
fill(200,200,200,100);
vertex(xTwo+10,yTwo+60);
vertex((xTwo-10),(yTwo+100));
vertex((xTwo+30),(yTwo+80));
vertex((xTwo-10),(yTwo+80));
vertex((xTwo+30),(yTwo+100));
endShape(CLOSE);
if (y > 380){
changeY = changeY - 5;
}
if (otherY > 380){
changeOtherY = changeOtherY - 7;
}
if (yTwo > 350){
changeYTwo = changeYTwo - 7;
}
if (y < 20){
changeY = 5;
}
if (otherY < 20){
changeOtherY = 7;
}
if (yTwo < -60){
changeYTwo = changeYTwo + 7;
}
if (x > 380){
changeX = changeX -5;
}
if (otherX > 380){
changeOtherX = changeOtherX -7;
}
if (xTwo > 380){
changeXTwo = changeXTwo -7;
}
if (x < 20){
changeX = 5;
}
if (otherX < 20){
changeOtherX = 7;
}
if (xTwo < 20){
changeXTwo = changeXTwo + 7;
}
if (redCol > 100){
altGreCol = altGreCol + 0.1;
greCol = greCol + altGreCol;
}
if (greCol > 100){
altBluCol = altBluCol + 0.1;
bluCol = bluCol + altBluCol;
}
if (bluCol > 100){
//altRedCol = altRedCol + 1
altRedCol = -0.1;
altGreCol = -0.1;
altBluCol = -0.1;
}
if (altRedCol == 0){
altRedCol = altRedCol + 0.1;
}
}