Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
whizzpopping100
whizzpopping100's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
can't find a class or name error
[4 Replies]
27-May-2011 08:36 AM
Forum:
Programming Questions
i can't figer it out why i am getting this error, it was working fine first time.
please help t.t
Aliens[] aliens;
int totalAliens =0;
Ship ship,ship1;
PImage backGround;
void setup() {
frameRate(15);
size(600,700);
backGround = loadImage("back.png");
aliens=new Aliens[500];
smooth();
// Load image, initialize variables
ship = new Ship("ship.png",0,0);
ship1 = new Ship("ship1.png",0,0);
}
void draw() {
image(backGround,0,0);
ship.display();
ship1.display();
aliens[totalAliens]= new Aliens();
totalAliens++;
for (int i = 0; i < totalAliens; i++) {
aliens[i].move(); aliens[i].display();
}
}
class Aliens
{
PImage Aliens1;
float x,y; float speed;
Aliens() {
x = random(width); y = -2*10; speed = random(1,10);
Aliens1=loadImage("s.png");}
void move() {
y += speed;} // Increment by speed
// Check if it hits the bottom
boolean reachedBottom() {
// Variables for location of raindrop // Speed of raindrop
// Radius of raindrop
if (y > height+2*4) { // If we go a little beyond the bottom
return true;
} else { return false;
}
}
void display(){
image( Aliens1,x,y);
{
// If the drop is caught void caught() {
speed = 2;
}}
// A head object!
class Ship{
PImage ship; // A variable for the image file
PImage ship1;
float x,y; // Variables for image location
Ship(String filename, float x_, float y_) {
// Load image, initialize variables
ship = loadImage("ship.png");
ship1 = loadImage("ship1.png");
x = x_;
y = y_;
}
void display(){
image(ship,0,550);
image(ship1,500,550);
}
}
}
«Prev
Next »
Moderate user : whizzpopping100
Forum