Recent Posts
None | 1 sec ago
Lua | 2 sec ago
None | 20 sec ago
Lua | 24 sec ago
C++ | 26 sec ago
None | 28 sec ago
PHP | 35 sec ago
None | 50 sec ago
C | 51 sec ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Spoon on the 10th of Feb 2010 12:16:51 AM
Download |
Raw |
Embed |
Report
Alien aliens[];
Player player;
PImage invader, explode;
void setup() {
size(SCREENX, SCREENY);
invader = loadImage ("invader.GIF");
explode = loadImage ("exploding.GIF");
aliens = new Alien[10];
init_aliens(aliens, invader, explode);
player = new Player(350);
frameRate = 5;
}
void init_aliens(Alien baddies[], PImage okImg, PImage exImg){
for(int i=0; i<aliens.length; i++){
baddies[i] = new Alien(i*(okImg.width+GAP), 0, okImg, exImg);
}
}
void draw(){
print (player.xposish);
player.move(mouseX);
player.draw();
background(0);
move_array(aliens);
draw_array(aliens);
}
void draw_array(Alien aliens[]){
for(int i=0; i<aliens.length; i++)
aliens[i].draw();
}
void move_array(Alien aliens[]){
for(int i=0; i<aliens.length; i++)
aliens[i].move();
}
Submit a correction or amendment below.
Make A New Post