/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.G6l2HSyczcL/rev.366
*
* authors:
* zeke
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// Zeke Perkins
// Sunday, September 23rd, 2012
// [email protected]
// The sketch is about what's going to happen in April when Sproj is due.
// The stick figure is me and moves along y = 400 and mouseX. The
// fireballs are a little bit more complicated and use a number of
// variables. When you press a key it all happens and you can try and
// dodge responsibility and adulthood. The Armegeddon text looks
// better in the original, because sketchpad doesn't have the same fonts,
// which I will upload to Moodle.
//variables
float dy = 0;
float circle = 0;
float startPosX;
float startPosY;
float posX = 500;
void setup() {
size(500, 500);
background(57, 120, 126);
noStroke();
fill(36, 50, 52);
rect(-1, 400, 520, 100);
colorMode(RGB);
}
void keyPressed() {
dy = -5;
}
void draw() {
// set up
background(57, 120, 126);
fill(36, 50, 52);
rect(-1, 400, 520, 100);
fill(245, 17, 86);
PFont font = loadFont("BookmanOldStyle-40.vlw");
textFont (font);
text("Armegeddon", 120, 100);
// stick figure
fill(194, 205, 206);
stroke(2);
ellipse(mouseX, 350, 20, 20);
line(mouseX, 360, mouseX, 380);
line(mouseX, 380, mouseX - 20, 400);
line(mouseX, 380, mouseX + 20, 400);
line(mouseX, 370, mouseX - 20, 340);
line(mouseX, 370, mouseX + 20, 340);
//falling fireballs
noStroke();
fill(240, 7, 0, 250);
ellipse(250, startPosY, 40, 40);
ellipse(posX, startPosY, 40, 40);
ellipse(startPosX, startPosY, 40, 40);
startPosY = startPosY - dy;
startPosX = startPosX - dy;
posX = posX + dy;
//repeat
if(startPosY > 500) {
startPosY = 0;
}
if(startPosX > 500) {
startPosX = 0;
}
if(posX < 0){
posX = 500;
}
}