Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
4 OccupyBullStreet.pde
@@ -79,7 +79,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
@@ -140,7 +140,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
View
11 Student.pde
@@ -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));
@@ -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
@@ -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() {
View
0 data/hit1.aif → data/hit.01.aif
File renamed without changes.
View
0 data/hit2.aif → data/hit.02.aif
File renamed without changes.
View
0 data/hit3 ouh.aif → data/hit.03.aif
File renamed without changes.

No commit comments for this range

Something went wrong with that request. Please try again.