xxxxxxxxxx
105
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
if (mouseX < width / 2) {
//background("yellow");
// draw a spring creature
//drawSummerCreature(mouseX, mouseY, 0.01, 0.5);
drawSummerCreature(mouseX,mouseY,0.01, 0.5);
} else {
//background("cyan")
// draw a winter creature
//drawWinterCreature(mouseX, mouseY, 0.01, 0.5);
drawWinterCreature(mouseX,mouseY, 0.01, 0.5);
// draw a summer creature
}
// functions defined below
// // Function to draw a basic circle creature
// function drawCreature(creatureColor,x, y, spd, scl) {
// push();
// fill(creatureColor);
// translate(x, y);
// rotate(frameCount * spd); // rotates below stuff
// scale(scl);
// noStroke();
// ellipse(0, 0, 100, 100);
// pop();
// draw a summer creature
function drawWinterCreature(x, y, spd, scl) {
push();
fill("white");
translate(x, y);
rotate(frameCount * spd); // rotates below stuff
scale(scl);
noStroke();
// design a winter creature
strokeWeight(10);
stroke("purple");
ellipse(0, 0, 150, 150);
noStroke();
fill("green")
ellipse(0, 0, 100, 100);
fill("cyan")
ellipse(0, 0, 50, 200);
fill("cyan")
ellipse(0, 0, 200, 50);
fill("green")
ellipse(0,0, 30, 30);
pop();
}
// draw a winter creature
function drawSummerCreature(x, y, spd, scl) {
push();
fill("purple");
translate(x, y);
rotate(frameCount * spd); // rotates below stuff
scale(scl);
noStroke();
// design a summer creature
ellipse(0, 0, 200, 200);
fill("pink");
ellipse(0, 0, 100, 100);
pop();
}
// drawing side circles function!
function shooters(x, y, distance, dia) {
push();
fill("#f9a875");
translate(x, y);
for (let i = 0; i < 3; i++) {
circle(x + distance, y, dia);
distance -= 50; // changes where the center of the circle is for the next circle
}
pop();
// // 2. Function to draw rotating star
// function drawStar(x, y, spd, scl) {
// push();
// translate(x, y);
// rotate(frameCount * spd); // rotates below stuff
// scale(scl);
// noStroke();
// ellipse(0, 0, 100, 20);
// ellipse(0, 0, 20, 100);
// pop();
//}
}