game.core
Class Asteroid

java.lang.Object
  extended by game.core.Sprite
      extended by game.core.Asteroid
All Implemented Interfaces:
java.lang.Cloneable

public class Asteroid
extends Sprite


Field Summary
(package private) static java.awt.Image[] ast
           
(package private) static java.awt.Image[] astb
           
private  double boredness
           
(package private) static int count
           
(package private) static double initialSpeed
           
(package private)  boolean nasty
           
(package private)  int number
           
 
Fields inherited from class game.core.Sprite
age, dx, dy, r, x, y
 
Constructor Summary
Asteroid(double dx, double dy)
           
Asteroid(double x, double y, double dx, double dy)
           
Asteroid(double x, double y, double dx, double dy, double r)
           
Asteroid(double x, double y, double dx, double dy, int size, boolean bad)
           
Asteroid(java.awt.Rectangle field)
          creates an asteroid starting in the corner
Asteroid(java.awt.Rectangle field, double size)
          creates an asteroid starting in the corner, with the given size
Asteroid(java.awt.Rectangle field, Rocket r)
          creates an asteroid starting in a corner, moving away from the rocket
 
Method Summary
 java.util.ArrayList<Asteroid> explode(Rocket rocket, java.awt.Rectangle field)
           
 java.util.ArrayList<Asteroid> explode(Rocket rocket, java.awt.Rectangle field, boolean isHit)
           
 double getBoredness()
           
 java.awt.Image getImage()
           
 double getMass()
           
private static double getNewDX()
          chooses a suitable initial x-speed
private static double getNewDY()
          chooses a suitable initial y-speed
 int getNumber()
           
 boolean isNasty()
           
 boolean isOkToHit()
           
 void setNumber()
           
private  void updateBoredness()
           
 
Methods inherited from class game.core.Sprite
clone, getDX, getDY, getSize, getX, getY, touches, updatePositionWrap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

number

int number

initialSpeed

static double initialSpeed

count

static int count

ast

static java.awt.Image[] ast

astb

static java.awt.Image[] astb

nasty

boolean nasty

boredness

private double boredness
Constructor Detail

Asteroid

public Asteroid(double x,
                double y,
                double dx,
                double dy,
                double r)

Asteroid

public Asteroid(double x,
                double y,
                double dx,
                double dy)

Asteroid

public Asteroid(double dx,
                double dy)

Asteroid

public Asteroid(java.awt.Rectangle field,
                Rocket r)
creates an asteroid starting in a corner, moving away from the rocket


Asteroid

public Asteroid(java.awt.Rectangle field)
creates an asteroid starting in the corner


Asteroid

public Asteroid(java.awt.Rectangle field,
                double size)
creates an asteroid starting in the corner, with the given size


Asteroid

public Asteroid(double x,
                double y,
                double dx,
                double dy,
                int size,
                boolean bad)
Method Detail

getNumber

public int getNumber()

setNumber

public void setNumber()

getNewDX

private static double getNewDX()
chooses a suitable initial x-speed


getNewDY

private static double getNewDY()
chooses a suitable initial y-speed


explode

public java.util.ArrayList<Asteroid> explode(Rocket rocket,
                                             java.awt.Rectangle field,
                                             boolean isHit)

explode

public java.util.ArrayList<Asteroid> explode(Rocket rocket,
                                             java.awt.Rectangle field)

getImage

public java.awt.Image getImage()

isNasty

public boolean isNasty()

isOkToHit

public boolean isOkToHit()

getMass

public double getMass()

getBoredness

public double getBoredness()

updateBoredness

private void updateBoredness()