Skip to content

Instantly share code, notes, and snippets.

@Jl9549
Created April 15, 2019 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jl9549/c40df7100e3f9569979c8c75add094a8 to your computer and use it in GitHub Desktop.
Save Jl9549/c40df7100e3f9569979c8c75add094a8 to your computer and use it in GitHub Desktop.
Spring is Coming
PImage bg;
int y;
void setup() {
size(500, 500);
bg = loadImage("Flowers.jpg");
background(bg);
stroke(226, 204, 0);
line(0, y, width, y);
y++;
if (y > height) {
y = 0;
}
}
void draw() {
if(mousePressed ==true)
{
makeLadybug();
}
}
//creates a ladybug
void makeLadybug()
{
int mainX = int(random(500));
int mainY = int(random(500));
fill(255, 0, 0);
ellipse(mainX, mainY, 15, 15);
fill(0);
ellipse(mainX, mainY, 3, 3);
ellipse(mainX + 3, mainY -5, 3, 3);
ellipse(mainX - 3, mainY -5, 3, 3);
fill(0);
ellipse(mainX, mainY+4, 5, 5);
}
//clears away the ladybugs
void keyPressed()
{
bg = loadImage("Flowers.jpg");
background(bg);
stroke(226, 204, 0);
line(0, y, width, y);
y++;
if (y > height) {
y = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment