Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ReturningValues/ReturningValues.pde
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
float c;
PImage art;

void setup(){
size(600,600);
art = loadImage("art.jpg");
}

void draw(){
background(art);
c = PythagoreanTheorem();
textSize(100);
textAlign(CENTER, CENTER);
text(c,300,300);
}

float PythagoreanTheorem(){
float a= 6;
float b= 5;
float c= sqrt(sq(a)+sq(b));
return c;
}
Binary file added ReturningValues/data/art.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions VoidFunctions/VoidFunctions.pde
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
//name variables
PImage derp;
PImage icecream;
float gameMode;

void setup() {
//set canvas size
size(600, 600);

//load image
derp = loadImage("newderp.png");
icecream = loadImage("icecream.png");

gameMode=0;
}

void draw() {
//create background
background(300,300,300);

if(gameMode==0){
fill(0);
textSize(30);
text("Help Kanye reach his true love",80,height/2);
}
if (gameMode==1) {
drawIceCreamAt(random(width),random(height));
drawKanyeAt(mouseX-400,mouseY-300);
}
}


void drawKanyeAt(float x, float y) {
x = mouseX-200;
y = mouseY-150;
image(derp, x, y);
derp.resize(400,300);
}

void drawIceCreamAt(float i, float j){
i = random(width)-37.5;
j = random(height)-50;
image(icecream, i, j);
icecream.resize(75,100);
}

void mousePressed(){
gameMode=1;
}
Binary file added VoidFunctions/data/icecream.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VoidFunctions/data/newderp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VoidFunctions/data/neweyes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.