|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Sprite | +--SpriteAsteroid
Our jagged asteroid sprites, they come in two sizes.
Field Summary | |
(package private) static double |
ageDoneStormpause
The number of updates to pause between waves of asteroids. |
(package private) static double |
agegame
The age of the whole flock of asteroids |
(package private) boolean |
asteroidIsSmall
Flag used to distinguish between big and small asteroids. |
(package private) static int |
asteroidsLeft
Number of asteroids remaining. |
(package private) static int |
BIG_POINTS
Points for shooting a big asteroid. |
(package private) boolean |
darting
Use this to allow temporary speedup when running away from a bullet. |
(package private) static int |
FRAG_COUNT
Number of fragments to split an asteroid into. |
(package private) static int |
MAX_SIDES
Max number of asteroid sides. |
(package private) static int |
MIN_SIDES
Min number of asteroid sides. |
(package private) static int |
SMALL_POINTS
Points for shooting a small asteroid. |
Fields inherited from class Sprite |
acceleration,
active,
age,
ageDone,
angle,
angularAcceleration,
bounce,
edgecolor,
fillcolor,
fillflag,
game,
mass,
maxspeed,
ownerApp,
position,
positiontransform,
radius,
shape,
shapetransform,
soundplaying,
velocity |
Constructor Summary | |
SpriteAsteroid(RealPixelConverter rtopc)
|
Method Summary | |
boolean |
advance(double dt)
Give the asteroids an ability to speed up for darting. |
void |
bounceOff(SpriteAsteroid asteroid)
The idea in this algorithm is that the caller asteroid C and the argument asteroid A will do some exchange of their velocities. |
void |
collideAsteroids()
Check if you're colliding with any other asteroids, and if you are, update your velocity and position accordingly. |
void |
reset(RealPixelConverter rtopc)
Creates a random jagged shape and movement. |
void |
split(int fragcount,
RealPixelConverter rtopc)
Create one or more smaller asteroids from a larger one using inactive asteroids. |
void |
update(RealPixelConverter rtopc)
If hit by bullet, kill asteroid and advance score. |
Methods inherited from class Sprite |
draw,
explode,
fixRadius,
isColliding,
isTouching,
loopsound,
mass,
radius,
randomizeFillcolor,
render,
setFakeRadius,
stop,
wrapandbounce |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int MIN_SIDES
static final int MAX_SIDES
static final int BIG_POINTS
static final int SMALL_POINTS
static final int FRAG_COUNT
boolean asteroidIsSmall
static int asteroidsLeft
static double ageDoneStormpause
static double agegame
boolean darting
Constructor Detail |
public SpriteAsteroid(RealPixelConverter rtopc)
Method Detail |
public void reset(RealPixelConverter rtopc)
public void split(int fragcount, RealPixelConverter rtopc)
public boolean advance(double dt)
public void bounceOff(SpriteAsteroid asteroid)
public void collideAsteroids()
public void update(RealPixelConverter rtopc)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |