Professional Documents
Culture Documents
//**************************************************************
//Matthew Mitchell
//8/18/15
//floating_alien.java
//Al alien animation program
//**************************************************************
import java.awt.*;
int x = 75;
int y = 75;
int red = 0;
int blue = 0;
int green = 0;
public boolean click = false;
ArrayList <Alien> aliens;
Teleporter gun;
ArrayList <Beam> rays;
int aliensToAdd = 11;
void setup()
{
size(1000, 700);
background(0, 100, 200);
fill(red, green, blue);
//making the arrays and objects
aliens = new ArrayList<Alien>();
gun = new Teleporter(75, height - 100);
rays = new ArrayList<Beam>();
Alien al = new Alien(x, y);
aliens.add(al);
}
void draw()
{
background(0, 100, 200);
if (aliens.size() > 0)
{
}
}
}
}
void mouseClicked()
{
rays.add(new Beam(gun.cX + gun.midpoint, gun.cY + 60));
}
Class Alien
class Alien
{
public int cX;
public int cY;
public int xVelocity = 7;
//height of alien not counting head
final static int HEIGHT = 130;
//length from cX to end of left hand
final static int WIDTH = 130;
//total width of alien
final static int WINGSPAN = 210;
//total height of alien head to toe
final static int HEADTOTOE = 180;
final static int HEADHEIGHT = 50;
final static int HEADWIDTH = 70;
final static int BODYHEIGHT = 70;
final static int BODYWIDTH = 50;
//public int yVelocity = 1;
Alien(int x, int y)
{
cX = x;
cY = y;
}
void draw()
{
noFill();
//alien movement