Hello, I'm on pages 19-20 of Chapter 14 of the Ira Greenberg book, and I am in a world of pain. It says that to convert this Processing code:
Quote:int birdCount = 300;
Bird[] birds = new Bird[birdCount];
float[] x = new float[birdCount];
float[] y = new float[birdCount];
float[] z = new float[birdCount];
float[] rx = new float[birdCount];
float[] ry = new float[birdCount];
float[] rz = new float[birdCount];
float[] spd = new float[birdCount];
float[] rot = new float[birdCount];
void setup(){
size(400, 400, P3D);
noStroke();
for (int i =0; i < birdCount; i++) {
birds[i] = new Bird(random(-300, 300), random(-300, 300),
random(-500, -2500), random(5, 30), random(5, 30));
birds[i].setColor(color(random(255), random(255), random(255)),
color(random(255), random(255), random(255)));
x[i] = random(20, 340);
y[i] = random(30, 350);
z[i] = random(1000, 4800);
rx[i] = random(-160, 160);
ry[i] = random(-55, 55);
rz[i] = random(-20, 20);
spd[i] = random(.1, 3.75);
rot[i] = random(.025, .15);
print(this);
}
}
void draw(){
background(150, 120, 255);
lights();
for (int i = 0; i < birdCount; i++){
birds[i].setFlight(x[i], y[i], z[i], rx[i], ry[i], rz[i]);
birds[i].setWingSpeed(spd[i]);
birds[i].setRotSpeed(rot[i]);
birds[i].fly();
}
}
into Java mode, all I need to do is add "
public class Flock extends PApplet {" at the top of the code, a "
}" at the end of the code, a "
this" argument to the Bird instantiation call, and I should be able to run the code. Instead I get the following error message: "Cannot parse error text: File C:\DOCUME~1\cmena\LOCALS~1\Temp\build56498.tmp\Flock.java is missing"
Are there additional steps that are missing? Do I need to put this code into a new tab or rename it? This is driving me insane.