Skip to content

Instantly share code, notes, and snippets.

@sabotai
Created February 17, 2016 21:46
Show Gist options
  • Save sabotai/4974d27cd8b8abbc5e95 to your computer and use it in GitHub Desktop.
Save sabotai/4974d27cd8b8abbc5e95 to your computer and use it in GitHub Desktop.
GD105 Spring 2016 Week 3
PImage cage;
PImage bg;
int cageW, cageH;
int cageX, cageY;
void setup(){
size(1280,720);
bg = loadImage("funny_giraffe_25.jpg");
cage = loadImage("cagey.png");
cageW = 150;
cageH = 150;
cageX = 0;
cageY = height/2;
}
void draw(){
cageW = cageW + 5;
cageH = int( cageW * 0.5 );
cageX = millis() / 40;
cageY = int( height/2 + (200 * sin(cageX)) );
println("a message... like cageW is equal to... " + cageW);
//try using "tint(*, *, *, *);"
imageMode(CORNER);
image(bg, 0, 0, width, height);
imageMode(CENTER);
image(cage,cageX,cageY, cageW, cageH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment