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
16 changes: 16 additions & 0 deletions BasicImages/BasicImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
PImage kirby;
int scalefactor = 2;

void setup() {
size(800,800);

kirby=loadImage("kirby.gif");
}

void draw() {
//background(0);
noCursor();
tint(200, 10,10);
image(kirby, mouseX, mouseY, kirby.width/4, kirby.height/4);
tint(random(255), random(255), random(255));
image(kirby, random(width), random(height), kirby.width/4, kirby.height/4);
}
Binary file added BasicImages/data/kirby.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions FilteringImages/FilteringImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
PImage trees2;
int scalefactor = 2;

void setup() {
size(800,800);

trees2 =loadImage("trees2.jpg");
}

void draw() {
//background(0);


tint(random(255), random(255), random(255));
tint(115, 10);
image(trees2, random(width), random(height), trees2.width/4, trees2.height/4);
}
Binary file added FilteringImages/data/kirby.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 126 additions & 0 deletions IndependentImagePractice/IndependentImagePractice.pde
Original file line number Diff line number Diff line change
@@ -1 +1,127 @@
PImage kirby;
PImage toonlink;
PImage bridge;
int scalefactor = 2;
float g;
float x, y, x2, y2, velX, velY, diam, blurry, velY2, velX2;
boolean up, down, left, right;

void setup() {
size(1400, 600);
x = width/2;
y = height/2;
x2 = 400;
y2 = 475;
diam = 100;
velX = (-5);
velY= (5);
velX2 = (-5);
velY2= (5);
g =.1;
blurry=6;
kirby=loadImage("kirby.gif");
toonlink=loadImage("toon link.jpg");
bridge=loadImage("bridge.jpg");
colorMode(HSB, 360, 100, 100, 100);
}

void draw() {
background(0);
velY= velY + g; //adding gravity
velY2= velY2 + g;
tint(255);
image(bridge, 0, 0, width, height);
tint(frameRate%360, 100, 100, 100); //rainbow tint color
image(toonlink, x2, y2, diam, diam); //insert toonlink
if (x2 + diam >= width) {
velX2 = -abs(velX2)*1.15; //if the kirby hits the right wall, bounce and slow down
velY2 = abs(velY2);
} else if (x2 + diam/15 <= 0) {
velX2 = abs(velX2)*1.15; //if the kirby hits the left wall, bounce and slow down
velY2 = abs(velY2)*1.15;
}
if (y2 + diam >= 475) { //bounce at bottom
velY2 = -abs(velY2)*.65; // reduce velY
} else if (y2 - diam <= 0) { //bounce at top
velY2 = abs(velY2);
}
if (y2 + diam >= 475 && velY2 > 0) { //slowing velY at botom
velY2 = 0;
g = 0;
}
if (left) {
x2=x2-10;
}
if (right) {
x2= x2 +10;
}

image(kirby, x, y, diam, diam); //insert kirby


//filter(BLUR, blurry);
x += velX;
y += velY;
x2 += 0;
y2 += 0;


if (x + diam >= width) {
velX = -abs(velX)*1.05; //if the kirby hits the right wall, bounce and slow down
velY = abs(velY);
} else if (x + diam/15 <= 0) {
velX = abs(velX)*1.15; //if the kirby hits the left wall, bounce and slow down
velY = abs(velY)*1.15;
}
if (y + diam >= height-25) { //bounce at bottom
velY = -abs(velY)*.65; // reduce velY
} else if (y + diam <= 0) { //bounce at top
velY = abs(velY);
}
if (y + diam >= height && velY > 0) { //slowing velY at botom
velY = 0;
g = 0;

}
if (y + diam/2 >= height && velY > 0 && velX > 0) { //slowing velX at bottom
velY = 0;
g=0;
velX = velX *.75;
blurry= blurry-1;
}
if (y > 475) { //keeps balls from going off screen
y= 475;
velX= velX*.75;
}
if (mousePressed) {
velY= velY-.25; //make kirby fly
velX = velX+.5;
} else
velY = velY+.15;
}
void keyPressed() {

if (keyCode==LEFT) {
left = true;
}
if (keyCode==RIGHT) {

right = true;
}
if (keyCode==UP) {

up = true;
}
}
void keyReleased() {
if (keyCode==LEFT) {
left = false;
}
if (keyCode==RIGHT) {
right = false;
}
if (keyCode==UP) {

up = false;
}
}
Binary file added IndependentImagePractice/data/bridge.jpg
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 IndependentImagePractice/data/kirby.gif
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 IndependentImagePractice/data/toon link.jpg
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 IndependentImagePractice/data/toonlink2.jpg
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 IndependentImagePractice/data/trees2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions IndependentImagePractice/sketch_151130a/sketch_151130a.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PImage tower;

void setup() {
size(100, 100);
tower = loadImage("trees2.jpg");
int dimension = tower.width * tower.height;
tower.loadPixels();
for (int i = 0; i < dimension; i += 2) {
tower.pixels[i] = color(0, 0, 0);
}
tower.updatePixels();
}

void draw() {
image(tower, 0, 0);
}
23 changes: 23 additions & 0 deletions MaskingImages/MaskingImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
PImage trees2;
int scalefactor = 2;
float x, y;
void setup() {
// int dimension = trees2.width * trees2.height;
size(800,800);
x = width/2;
y = height/2;
trees2=loadImage("trees2.jpg");


{// trees2.loadPixels();
// for (int i = 0; i < dimension; i += 2) {
// trees2.pixels[i] = color(0, 0, 0);
}
// trees2.updatePixels();
}
//}


void draw() {
image(trees2, trees2.width/6, trees2.height/6);
}

Binary file added MaskingImages/data/kirby.gif
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 MaskingImages/data/trees2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.