Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Metalab/OccupyBullStreet
Browse files Browse the repository at this point in the history
  • Loading branch information
twissi committed Dec 11, 2011
2 parents 9eed677 + 10382e4 commit 50d8189
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 13 deletions.
12 changes: 7 additions & 5 deletions Bull.pde
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ class Bull extends BoundingBox{
Frames bullFrames;
int currentFrame = 0;
int frameCounter = 0;
AudioPlayer runSound;

Bull(float x, float y){
Bull(Minim minim, float x, float y){
super(x, y, 150, 200);
runSound = minim.loadFile("bull_loop.mp3");
runSound.loop();
bullFrames = new Frames("bull_", "png", 8);
col = color(126, 255, 102);
}
Expand All @@ -32,17 +35,16 @@ class Bull extends BoundingBox{
this.y = y;
}

void draw()
{
void draw() {
PImage bullImg = nextFrameImage();
w = bullImg.width/1.5-10;
w = bullImg.width/1.5;
h = bullImg.height/1.5;
stroke(204, 102, 0);
noFill();
rectMode(CENTER);
rect(x, y, w, h);
imageMode(CENTER);
image(bullImg, this.x-5, this.y, w,h);
image(bullImg, this.x, this.y, w,h);
noStroke();
}
}
9 changes: 5 additions & 4 deletions OccupyBullStreet.pde
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* https://github.com/Metalab/OccupyBullStreet
* --------------------------------------------------------------------------
* prog: Benjamin Fritsch / Kristin Albert / Jayme "The Bear" Cochrane
* thanks to Lukas Hasitschka for the audio awesomness
* date: 12/09/2011 (m/d/y)
* ----------------------------------------------------------------------------
*/
Expand Down Expand Up @@ -73,7 +74,7 @@ void setup() {


for (int i = 0; i <= studentCount-1; i++) {
students.add(new Student(studentSpeed));
students.add(new Student(minim, studentSpeed));
}

// enable depthMap generation
Expand All @@ -93,7 +94,7 @@ void setup() {
if(usekinect) {
size(context.depthWidth(), context.depthHeight());
} else {
bull = new Bull(width/2, height-100);
bull = new Bull(minim, width/2, height-100);
}
// enter fullscreen mode
//fs.enter();
Expand Down Expand Up @@ -127,7 +128,7 @@ void draw() {

//generate students
if(students.size()<studentCount){
students.add(new Student(studentSpeed));
students.add(new Student(minim, studentSpeed));
}

//keep track of students on screen
Expand Down Expand Up @@ -196,7 +197,7 @@ void drawSkeleton(int userId) {
context.convertRealWorldToProjective(neck_kinect, neck);

if (bull == null) {
bull = new Bull(neck.x, neck.y);
bull = new Bull(minim, neck.x, neck.y);
}

float distanceToMiddle = width/2 - neck.x;
Expand Down
11 changes: 7 additions & 4 deletions Student.pde
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ class Student extends BoundingBox {
boolean alive;
int lane;
boolean outsideScreen;
AudioPlayer dieSound;

String[] images = {"protestor.03","protestor.02","protestor.01"};
String[] images = {"03","02","01"};
int[] lanes = {100,200,300,400,500};

Student(int speed) {
Student(Minim minim, int speed) {
super(0, 0, 20, 20);
imgIndex = int(random(images.length));
laneIndex = int(random(lanes.length));
Expand All @@ -21,7 +22,8 @@ class Student extends BoundingBox {
this.speed = speed;
x = lanes[laneIndex];
y = int(random(-800, 0));
alienImg = loadImage(images[imgIndex]+".up.png");
alienImg = loadImage("protestor." + images[imgIndex] + ".up.png");
dieSound = minim.loadFile("hit." + images[imgIndex] + ".aif");
}

// update the position
Expand All @@ -39,7 +41,8 @@ class Student extends BoundingBox {

void die(){
this.alive = false;
alienImg = loadImage(images[imgIndex]+".down.png");
dieSound.play();
alienImg = loadImage("protestor." + images[imgIndex] + ".down.png");
}

void draw() {
Expand Down
Binary file added data/bull_loop.mp3
Binary file not shown.
Binary file added data/hit.01.aif
Binary file not shown.
Binary file added data/hit.02.aif
Binary file not shown.
Binary file added data/hit.03.aif
Binary file not shown.
Binary file added data/neck break scream.aif
Binary file not shown.
Binary file modified data/protesters.mp3
Binary file not shown.
Binary file modified data/protestor.01.down.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 modified data/protestor.01.up.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 modified data/protestor.02.down.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 modified data/protestor.02.up.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 modified data/protestor.03.down.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 modified data/protestor.03.up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 50d8189

Please sign in to comment.