Skip to content
Merged
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ An ongoing series of food and code hackathons.

The code included in this folder is being used for the Github Potluck hosted at Parsons The New School for Design. Details for the Github Potluck are:

When: Thursday (10/11) & Monday (10/15), 5 – 7pm
Where: 6 E 16th Street, Room 1205
What: Bring a computer, a penchant for text editing, and a dish of something you enjoy.
<strong>When:</strong> Thursday (10/11) & Monday (10/15), 5 – 7pm

<strong>Where:</strong> 6 E 16th Street, Room 1205

<strong>What:</strong> Bring a computer, a penchant for text editing, and a dish of something you enjoy.

This is an opportunity for people to share delicious food and knowledge about design, technology, and life in general.

Expand Down
Binary file added code/comets/.DS_Store
Binary file not shown.
90 changes: 90 additions & 0 deletions code/comets/comets.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Comets
* To show rotations on XY and Z axis
*
* CC Fall 2012
* by Ryan Raffa
* 10/05/12
*/

int xOne, yOne;
int xTwo, yTwo;
int xThree, yThree;

PImage psy;
PImage psyBody;
PImage psyFire;

float deg, degTwo, degThree;
float radOne, radTwo, radThree;

void setup() {

size(600,375, P3D);

xOne = -100;
yOne = 0;

xTwo = 0;
yTwo = -100;

xThree = 100;
yThree = 0;

deg = 0.0;
degTwo = 90.0;

psy = loadImage("PSY1.png");
psyBody = loadImage("PSY1_body.png");
psyFire = loadImage("PSY1_fire.png");
}

void draw() {
background(0);



rectMode(CENTER);

image(psyFire, 0, 0);
image(psyBody, 0, 0);

translate(width/2,height/3);

//red lines
pushMatrix();

fill(255);
ellipse(0,0,50,50);

//red square
deg+=2;
if(deg > 360) deg = 0.0;
radOne = radians(deg);
rotateY(radOne);
fill(255,0,0);
rect(xOne, yOne, 50, 50);

//psy face
translate(xThree, yThree);
pushMatrix();
degTwo += 1/3;
if(degTwo > 360) degTwo = 0.0;
radTwo = radians(degTwo);
rotateY(radTwo);
image(psy, -50,-50);
popMatrix();

popMatrix();

//green circle
pushMatrix();
degThree-=4;

radThree = radians(degThree);
rotate(radThree);
fill(0,255,0);
ellipse(xTwo*2, yTwo*2, 50, 50);
popMatrix();

}
Binary file added code/comets/data/PSY1.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 code/comets/data/PSY1.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 code/comets/data/PSY1_body.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 code/comets/data/PSY1_fire.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 code/maps/.DS_Store
Binary file not shown.
Binary file added code/maps/data/ff_character_original.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 code/maps/data/ff_character_standing.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 code/maps/data/ff_character_walkDownA.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 code/maps/data/ff_character_walkDownB.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 code/maps/data/ff_character_walkLeftA.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 code/maps/data/ff_character_walkLeftB.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 code/maps/data/ff_character_walkRightA.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 code/maps/data/ff_character_walkRightB.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 code/maps/data/ff_character_walkUpA.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 code/maps/data/ff_character_walkUpB.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 code/maps/data/ff_map.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 code/maps/data/ff_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions code/maps/maps.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Maps
* Moving through space with Final Fantasy
*
* CC Fall 2012
* by Ryan Raffa
* 10/05/12
*/

PVector mapPos;
PVector characterPos;

PImage mainMap;
PImage walkRightA;
PImage walkRightB;
PImage walkLeftA;
PImage walkLeftB;
PImage walkUpA;
PImage walkUpB;
PImage walkDownA;
PImage walkDownB;
PImage standing;

void setup() {

size(200,200);
background(255);

mainMap = loadImage("ff_map.jpg");
walkRightA = loadImage("ff_character_walkRightA.png");
walkRightB = loadImage("ff_character_walkRightB.png");
walkLeftA = loadImage("ff_character_walkLeftA.png");
walkLeftB = loadImage("ff_character_walkLeftB.png");
walkUpA = loadImage("ff_character_walkUpA.png");
walkUpB = loadImage("ff_character_walkUpB.png");
walkDownA = loadImage("ff_character_walkDownA.png");
walkDownB = loadImage("ff_character_walkDownB.png");
standing = loadImage("ff_character_standing.png");

mapPos = new PVector(mainMap.width/2, mainMap.height/2);
characterPos = new PVector(width/2, height/2);

}

void draw() {

imageMode(CENTER);
image(mainMap, mapPos.x, mapPos.y);


if (keyPressed == true) {
if (key == CODED) {
if (keyCode == UP) {
if(millis()%500 <= 250) { image(walkUpA,characterPos.x, characterPos.y); }
else { image(walkUpB,characterPos.x, characterPos.y); }

if (mapPos.y < 223 && characterPos.y == 100) {
mapPos.y++;
} else if (characterPos.y > standing.height/2){
characterPos.y--;
}

println("mapPos.y: " + mapPos.y);
println("characterPos.y: " + characterPos.y);

}
if (keyCode == DOWN) {
if(millis()%500 <= 250) { image(walkDownA,characterPos.x, characterPos.y); }
else { image(walkDownB,characterPos.x, characterPos.y); }

if (mapPos.y > -22 && characterPos.y == 100) {
mapPos.y--;
} else if (characterPos.y < height - standing.height/2){
characterPos.y++;
}

println("mapPos.y: "+ mapPos.y);
println("characterPos.y: "+ characterPos.y);
}

if (keyCode == RIGHT) {
if(millis()%500 <= 250) { image(walkRightA,characterPos.x, characterPos.y); }
else { image(walkRightB,characterPos.x, characterPos.y); }

if (mapPos.x > -108 && characterPos.x == 100) {
mapPos.x--;
} else if (characterPos.x < width-standing.width/2){
characterPos.x++;
}

println("mapPos.x: "+ mapPos.x);
println("characterPos.x: "+ characterPos.x);
}

if (keyCode == LEFT) {
if(millis()%500 <= 250) { image(walkLeftA,characterPos.x, characterPos.y); }
else { image(walkLeftB,characterPos.x, characterPos.y); }

if (mapPos.x < 312 && characterPos.x == 100) {
mapPos.x++;
} else if (characterPos.x > standing.width/2){
characterPos.x--;
}

println("mapPos.x: "+ mapPos.x);
println("characterPos.x: "+ characterPos.x);
}
}
}
else {
image(standing, characterPos.x, characterPos.y);
}

}
Binary file added code/reflections/.DS_Store
Binary file not shown.
78 changes: 78 additions & 0 deletions code/reflections/reflections.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Reflections
* To show ways to reflect drawings
*
* CC Fall 2012
* by Ryan Raffa
* 10/09/12
*/

import processing.pdf.*;

int cols;
int rows;

int[][] myArray;

// A boolean variable that when set to true triggers the PDF recording process
boolean recordPDF = false;

void setup() {
size(800,800, P3D);
cols = width;
rows = height;
// Declare 2D array
myArray = new int[rows][cols];

// Initialize 2D array values
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
if(i < width/2 && j < height/2) {
myArray[i][j] = int(220);
} else {
myArray[i][j] = int(250);
}
}
}

}

void draw() {

// Begin making the PDF
if (recordPDF) {
beginRaw(PDF, "####.pdf" ); // If you include "####" in the filename -- "3D-####.pdf" -- separate, numbered PDFs will be made for each frame that is rendered.
}


// Draw points
for (int i = 0; i < rows-1; i++) {
for (int j = 0; j < cols-1; j++) {
stroke(myArray[i][j]);
point(i,j);
}
}

// End making the PDF
if (recordPDF) {
endRaw();
recordPDF = false;
}

}

void mouseMoved() {

if (mouseX < width/2 && mouseY < height/2) {
myArray[mouseX][mouseY] = 0;
myArray[(width/2-mouseX)+width/2][mouseY] = 0;
myArray[mouseX][(height/2-mouseY)+height/2] = 0;
myArray[(width/2-mouseX)+width/2][(height/2-mouseY)+height/2] = 0;
}

}

// Make the PDF when the mouse is pressed
void mousePressed() {
recordPDF = true;
}