A B C D E F G H I J K L M N O P R S T U V W X Y

A

acceleration - Variable in class Sprite
The acceleration vector.
ACCELERATION_ASTEROID_DART - Static variable in class Units
Acceleration used by asteroid to avoid the nearest bullet.
ACCELERATION_ASTEROID_TOSHIP - Static variable in class Units
Acceleration towards the ship.
ACCELERATION_THRUST - Static variable in class Units
Acceleration in world widths per second per second.
active - Variable in class Sprite
A flag to indicate if the sprite is currently alive and visible.
add(Vector2) - Method in class Vector2
 
advance(double) - Method in class Sprite
Update the rotation and position coordinates based on the delta values.
advance(double) - Method in class SpriteAsteroid
Give the asteroids an ability to speed up for darting.
advance(double) - Method in class SpriteBullet
We'll deactivate a bullet if it wraps or bounces.
advance(double) - Method in class SpriteWall
Do-nothing advance method means don't move.
age - Variable in class Sprite
Measure the sprite's age in seconds to time things like explosions, hyperjumps and waits between bullet shots.
ageDone - Variable in class Sprite
Sprites can use the updateCounter to time things like explosions or a fade to black.
ageDoneHyperjump - Variable in class SpriteShip
A ship needs an ageDoneHyperjump as well as the Sprite ageDone, uses it for fading out of hyperjumps.
ageDoneShootwait - Variable in class SpriteShip
Use the ageShootwait to time the wait between bullets shot.
ageDoneShootwait - Variable in class SpriteUfo
Next time you can shoot a missile.
ageDoneStormpause - Static variable in class SpriteAsteroid
The number of updates to pause between waves of asteroids.
agegame - Static variable in class SpriteAsteroid
The age of the whole flock of asteroids
angle - Variable in class Sprite
The current rotation aspect.
angle() - Method in class Vector2
Returns the actual angle between -PI/2 and 3PI/2 of the vector's direction.
angle(Vector2, Vector2) - Static method in class Vector2
Returns an angle between -PI and PI expressing the turn from u to v.
angularAcceleration - Variable in class Sprite
The "acceleration" or speed at which the sprite is rotating.
asteroidIsSmall - Variable in class SpriteAsteroid
Flag used to distinguish between big and small asteroids.
asteroids - Variable in class AsteroidsGame
The asteroids.
Asteroids - class Asteroids.
Asteroids code can be used for an applet or an applciation.
Asteroids() - Constructor for class Asteroids
 
asteroidsgame - Variable in class Asteroids
The game object that holds all of our sprites.
AsteroidsGame - class AsteroidsGame.
This container class holds a spritevector with all the sprites, and keeps the SpriteBullet and SpriteExplosion in separate arrays so we can conveniently replace the oldest one when we want to make a new one.
AsteroidsGame(RealPixelConverter) - Constructor for class AsteroidsGame
Construct all your sprites and add them to spritevector.
asteroidsLeft - Static variable in class SpriteAsteroid
Number of asteroids remaining.

B

backgroundcolor - Static variable in class Asteroids
Background color.
BIG_POINTS - Static variable in class SpriteAsteroid
Points for shooting a big asteroid.
bounce - Variable in class Sprite
What to do when the asteroids hit the edge of the screen - initially false
bounceOff(SpriteAsteroid) - Method in class SpriteAsteroid
The idea in this algorithm is that the caller asteroid C and the argument asteroid A will do some exchange of their velocities.
bulletIndex - Variable in class AsteroidsGame
 
bullets - Variable in class AsteroidsGame
Use a phtons array so that we can always replace the oldest bullet by the newest bullet.

C

collideAsteroids() - Method in class SpriteAsteroid
Check if you're colliding with any other asteroids, and if you are, update your velocity and position accordingly.
collideflag - Variable in class AsteroidsGame
Flag for whether or not to calculate collisions between asteroids.
copy(Vector2) - Method in class Vector2
 
crashSound - Static variable in class Asteroids
Sound clip for ship hitting an asteroid.
currentsoundfilename - Variable in class Asteroids
 

D

darting - Variable in class SpriteAsteroid
Use this to allow temporary speedup when running away from a bullet.
DARTING_SPEEDUP - Static variable in class Units
Factor by which a darting asteroid is allowed to exceed its normal maxspeed.
detail - Variable in class Asteroids
A flag used to toggle more detail in the image.
difference(Vector2, Vector2) - Static method in class Vector2
 
diskflag - Variable in class AsteroidsGame
Flag for whether to use a rectangle or a disk for your world.
distanceTo(Vector2) - Method in class Vector2
 
dotproduct(Vector2, Vector2) - Static method in class Vector2
 
down - Variable in class SpriteShip
Key flag for down arrow key pressed.
draw(Graphics, boolean) - Method in class Sprite
Use the fillPolygon and drawPolygon functions to draw.
draw(Graphics, boolean) - Method in class SpriteShip
This fades the edge from black to white when you have a black fill, as is customary with a black background.
draw(Graphics, boolean) - Method in class SpriteExplosion
 
draw(Graphics, boolean) - Method in class SpriteWall
Draw method draws it as a disk if game.diskflag.
draw(Graphics, RealPixelConverter) - Method in class Vector2Colored
 
draw(Graphics, RealPixelConverter, boolean) - Method in class AsteroidsGame
Fill in background stars, draw the sprites.

E

edgecolor - Variable in class Sprite
The color to use for the sprite's outline.
explode(RealPixelConverter) - Method in class Sprite
Create sprites for explosion animation.
explosionIndex - Variable in class AsteroidsGame
 
explosions - Variable in class AsteroidsGame
So that we can always replace the oldest explosion line by the newest one, we need an array for the explosions.
explosionSound - Static variable in class Asteroids
Sound clip for bullet blowing up an asteroid, missile, or Ufo.

F

fillcolor - Variable in class Vector2Colored
 
fillcolor - Variable in class Sprite
The color to fill in the sprite with.
fillflag - Variable in class Sprite
Whether or not to fill the sprite in.
FIRE_WAIT_SHIP - Static variable in class Units
Seconds between bullet shots, so the bullets aren't too close together.
FIRE_WAIT_UFO - Static variable in class Units
Seconds between missile shots, so the missles aren't too often.
fire(RealPixelConverter) - Method in class SpriteShip
Make a sound and get a blank bullet slot or the oldest bullet slot and put a new bullet in there, aimed in your direction and starting at your location.
fire(RealPixelConverter) - Method in class SpriteUfo
 
fireSound - Static variable in class Asteroids
Sound clip for ship shooting a bullet.
firing - Variable in class SpriteShip
Machine-gun firing key.
fixAffineTransform() - Method in class RealPixelConverter
 
fixRadius() - Method in class Sprite
First sets the centroid to be the average of the shape vertices, then translatees the shape so that its centroid is at the origin, then sets the radius value as the maximum distance from the origin to one of the shape vertices.
font - Variable in class Asteroids
The font to use onscreen.
fontHeight - Variable in class Asteroids
 
fontmetric - Variable in class Asteroids
 
fontWidth - Variable in class Asteroids
 
foregroundcolor - Static variable in class Asteroids
Foreground color.
FRAG_COUNT - Static variable in class SpriteAsteroid
Number of fragments to split an asteroid into.

G

game - Variable in class Sprite
The "owner" game.
gameonflag - Variable in class AsteroidsGame
Flag to indicate if game is started and not yet over.
gameUpdate(double, RealPixelConverter) - Method in class AsteroidsGame
First call advance for all sprites, then render for all sprites, and then update for all sprites.
getAppletInfo() - Method in class Asteroids
 
getBounce() - Method in class AsteroidsGame
 
godmode - Static variable in class SpriteShip
Use this flag to mean that your ship never dies.

H

headTowardsSprite(Sprite, boolean) - Method in class SpriteMissile
At present this method is only used by the missile, but we might consider letting the asteroids use it too! The boolean flag tells whether to just menacingly aim yoursef (false) or to actually move this way (true).
HEIGHT_WORLD - Static variable in class Units
The height of the unchanging real world in which the Asteroids move, the document size, rather than the view size.
heightpixel - Variable in class RealPixelConverter
 
heightpixel() - Method in class RealPixelConverter
 
heightpixel() - Method in class Asteroids
Accessor to the current pixel dimensions of the view.
heightreal - Variable in class RealPixelConverter
 
heightreal() - Method in class RealPixelConverter
 
highScore - Static variable in class AsteroidsGame
High score for this play session.
HYPER_WAIT_SHIP - Static variable in class Units
Number of seconds that a ship is immune while doing a hyperjump.
hyperjump() - Method in class SpriteShip
Randomize your location and give yourself an "immunity" for a few cycles.

I

init() - Method in class Asteroids
Init does the work of a constructor: it creates a new AsteroidsGame.
initialize(Sprite, RealPixelConverter) - Method in class SpriteBullet
 
inverseTransform(double) - Method in class RealPixelConverter
 
inverseTransform(Vector2) - Method in class RealPixelConverter
 
inverseTransform(Vector2, Vector2) - Method in class RealPixelConverter
 
isColliding(Sprite) - Method in class Sprite
Just look at the distances between the positions of the two and compare to the sum of the radii.
isFocusTraversable() - Method in class Asteroids
In order for the panel to be able to get focus so it can use its KeyListener, I have to do this overload.
isTouching(Sprite) - Method in class Sprite
This is more accurate than isColliding, but a bit slower.

J

JDK - class JDK.
Use this class to hold a number to signal which version of the JDK I'm using here: 0 for 1.0, 1 for 1.1, 2 for 1.2.
JDK() - Constructor for class JDK
 

K

keyDown(Event, int) - Method in class Asteroids
Call the ship.keyPressed method and let the ship use the arrow keys, the spacebar and the h key.
keyPressed(int) - Method in class SpriteShip
Process the arrow keys and spacebar.
keyReleased(int) - Method in class SpriteShip
Process the arrow keys and spacebar.
keyUp(Event, int) - Method in class Asteroids
Call the ship.keyPressed method and let the ship use the arrow keys, the spacebar and the h key.

L

left - Variable in class SpriteShip
Key flag for left arrow key pressed.
LIFETIME_BULLET - Static variable in class Units
life in seconds.
LIFETIME_EXPLOSION - Static variable in class Units
Number of seconds that explosion lines live.
LIFETIME_MISSILE - Static variable in class Units
Missile lives long enough to cross the screen once.
LIFETIME_UFO - Static variable in class Units
Seconds that a UFO lives
loadSound(String) - Method in class Asteroids
This function tries to load a soundfile and return an audioclip.
loadSounds() - Method in class Asteroids
This uses the loadSound(AudioClip, String) function which has pieces to comment in and out depending on the JDK being used.
loadThread - Static variable in class Asteroids
This thread is for loading the sounds.
loopsound(boolean) - Method in class Sprite
The base method bails out if the the Asteroids soundsloaded isn't true, and it won't turn on a sound if Asteroids soundflag is off.
loopsound(boolean) - Method in class SpriteShip
Toggles the thrustersSound.
loopsound(boolean) - Method in class SpriteUfo
Toggles the saucerSound.
loopsound(boolean) - Method in class SpriteMissile
Toggles the missileSound.
loopThread - Static variable in class Asteroids
This thread is for driving the simulation updates.

M

m00 - Variable in class RealPixelConverter
 
m02 - Variable in class RealPixelConverter
 
m11 - Variable in class RealPixelConverter
 
m12 - Variable in class RealPixelConverter
 
magnitude() - Method in class Vector2
 
makenewstars() - Method in class AsteroidsGame
 
mass - Variable in class Sprite
We'll maintain the mass as the cube of the radius, setting it in the same fixRadius function that fixes the radius.
mass() - Method in class Sprite
Accessor
MAX_ASTEROIDS - Static variable in class AsteroidsGame
Number of asteroids that you can get by splitting up.
MAX_BULLETS - Static variable in class AsteroidsGame
Number of active bullets allowed.
MAX_EXPLOSIONS - Static variable in class AsteroidsGame
Total number of lines used to represent exploding objects.
MAX_SHIPS - Static variable in class AsteroidsGame
Starting number of ships per game.
MAX_SIDES - Static variable in class SpriteAsteroid
Max number of asteroid sides.
MAX_SIZE_ASTEROID - Static variable in class Units
Max size of asteroid side in world units.
MAX_SPEED_ASTEROID - Static variable in class Units
 
MAX_SPEED_BULLET - Static variable in class Units
Let Bullet go faster than the ship can go.
MAX_SPEED_SHIP - Static variable in class Units
Ship's maximum speed.
MAX_SPEED_SPRITE - Static variable in class Units
Default Sprite maxspeed, crosses world in 1.2 seconds.
MAX_TURN_SPEED_ASTEROID - Static variable in class Units
Max speed of asteroid rotation, in radians per second.
MAX_TURN_SPEED_EXPLOSION - Static variable in class Units
Max speed of explosion rotation.
maxspeed - Variable in class Sprite
The maximum speed.
MIN_SIDES - Static variable in class SpriteAsteroid
Min number of asteroid sides.
MIN_SIZE_ASTEROID - Static variable in class Units
 
MIN_SPEED_ASTEROID - Static variable in class Units
Min speed of asteroid motion in world units per update.
MIN_SPEED_UFO - Static variable in class Units
Min speed of Ufo motion in units per update.
missile - Variable in class AsteroidsGame
The missile.
MISSILE_POINTS - Static variable in class SpriteMissile
Points for shooting a Missile.
missileSound - Static variable in class Asteroids
Sound clip for the missile moving.
multiply(double) - Method in class Vector2
 

N

NEW_SHIP_POINTS - Static variable in class AsteroidsGame
Number of additional points needed to earn a new ship.
NEW_UFO_POINTS - Static variable in class AsteroidsGame
Number of additional points before a fresh Ufo attacks.
newShipScore - Static variable in class SpriteShip
Next score needed to get a new ship.
newUfoScore - Static variable in class SpriteUfo
The next score the player has to pass to make a new Ufo come to life.
nextAsteroid() - Method in class AsteroidsGame
This returns the slot of the next non-live asteroid, or null if there's no slot.
nextBoolean() - Method in class Randomizer
This is a copy of the code used for the Random nextBoolean() mehtod added in the JDK 1.2.
nextBullet() - Method in class AsteroidsGame
 
nextColor(double, double) - Method in class Randomizer
Return a Color in which the red, green and blue each have a a brightness between lo and hi percent of the maximum value.
nextDouble(double) - Method in class Randomizer
Return a double in the range 0 to hi exclusive of hi.
nextDouble(double, double) - Method in class Randomizer
Return a double in the range lo to hi exclusive of hi.
nextExplosion() - Method in class AsteroidsGame
 
nextInt(int) - Method in class Randomizer
This is a copy of the code used for the Random nextInt(int) mehtod added in the JDK 1.2.
nextInt(int, int) - Method in class Randomizer
Return an int in the range lo to hi inclusive.
nonzero() - Method in class Vector2
 
normalize() - Method in class Vector2
 

O

offDimension - Variable in class Asteroids
Size of the offscreen buffer.
offGraphics - Variable in class Asteroids
Graphics of the offscreen buffer.
offImage - Variable in class Asteroids
Image of the offscreen buffer.
ownerApp - Variable in class Sprite
The "owner" applet or application.

P

paint(Graphics) - Method in class Asteroids
 
paused - Variable in class AsteroidsGame
Flag for paused game.
position - Variable in class Sprite
The screen pixel position.
positiontransform - Variable in class Sprite
The pixel position.
product(double, Vector2) - Static method in class Vector2
Scalar product.

R

radius - Variable in class Sprite
The size of the thing.
RADIUS_WORLD - Static variable in class Units
Useful for disk wrap.
radius() - Method in class Sprite
We need an accessor for radius.
randomizeFillcolor() - Method in class Sprite
 
randomizer - Static variable in class Asteroids
Use this to randomize everybody's settings.
Randomizer - class Randomizer.
Add a few useful methods to the standard Random class.
Randomizer() - Constructor for class Randomizer
 
Randomizer(long) - Constructor for class Randomizer
 
realpixelconverter - Static variable in class Asteroids
Use this to convert between the real coordinates of the Sprite shape polygons and the pixel-sized coordinates used in the shapetransform by the draw function.
RealPixelConverter - class RealPixelConverter.
This class is designed to transform a real-number-sized window into a pixel window.
RealPixelConverter() - Constructor for class RealPixelConverter
 
RealPixelConverter(double, double, int, int) - Constructor for class RealPixelConverter
 
render(RealPixelConverter) - Method in class Sprite
Applies the rotation and the position translation to the shape to get the shapetransform polygon.
reset(RealPixelConverter) - Method in class Sprite
The abstract reset method is called by the child sprite constructors, and may also be called when resetting a sprite's state.
reset(RealPixelConverter) - Method in class SpriteShip
Puts the ship motionless in the middle of the screen.
reset(RealPixelConverter) - Method in class SpriteAsteroid
Creates a random jagged shape and movement.
reset(RealPixelConverter) - Method in class SpriteUfo
Randomly set flying saucer at an edge of the screen.
reset(RealPixelConverter) - Method in class SpriteMissile
 
reset(RealPixelConverter) - Method in class SpriteExplosion
 
reset(RealPixelConverter) - Method in class SpriteBullet
 
reset(RealPixelConverter) - Method in class SpriteWall
Do-nothing reset method means there's nothing to reset.
resetAsteroids(RealPixelConverter) - Method in class AsteroidsGame
Create START_ASTEROIDS asteroids, make them faster than before, put them out at the edge of the screen, and set SprieAsteroidpauseCounter.
resetBullets(RealPixelConverter) - Method in class AsteroidsGame
 
resetExplosions(RealPixelConverter) - Method in class AsteroidsGame
 
resetGame(RealPixelConverter) - Method in class AsteroidsGame
Initialize the game data.
right - Variable in class SpriteShip
Key flag for right arrow key pressed.
run() - Method in class Asteroids
First use the loadThread to load the sounds, then set loadThread to null and use a while loop on loopthread to repeatedly update the sprites and call repaint.

S

saucerSound - Static variable in class Asteroids
Sound clip for the Ufo moving.
scale() - Method in class RealPixelConverter
 
scale() - Method in class Asteroids
The conversion factor used in strectching or shrinking the real length to a pixel length.
score - Static variable in class AsteroidsGame
Game score.
set(double) - Method in class Vector2
 
set(double, double) - Method in class Vector2
Shorter name for existing Point2D setLocation method.
setFakeRadius(double) - Method in class Sprite
Use this to set a fake radius to make something hard to hit.
setMagnitude(double) - Method in class Vector2
 
setOwnerApp(Asteroids) - Method in class AsteroidsGame
 
setPixelWindow(Dimension) - Method in class Asteroids
Mutator to tell the converter about a new pixel view window size.
setPixelWindow(int, int) - Method in class RealPixelConverter
 
setRealWindow(double, double) - Method in class RealPixelConverter
 
setzero() - Method in class Vector2
 
shape - Variable in class Sprite
The basic shape which gets translated, rotated, and pixeld.
shapetransform - Variable in class Sprite
The transformed shape polygon, after the rotation and the translation.
ship - Variable in class AsteroidsGame
It's useful to have a distinguished name for the ship.
shipsLeft - Static variable in class SpriteShip
Number of ships left in game
SIZE_WORLD - Static variable in class Units
The minimum cross diameter of the world.
SMALL_POINTS - Static variable in class SpriteAsteroid
Points for shooting a small asteroid.
soundflag - Static variable in class Asteroids
A mute flag user can use to turn sound on and off.
soundplaying - Variable in class Sprite
Is the sound currently on?
soundsloaded - Static variable in class Asteroids
Use this flag to signal if you successfully loaded the sounds.
SPEED_BULLET - Static variable in class Units
Bullet speed in worlds per second.
SPEED_INCREMENT_ASTEROIDS - Static variable in class Units
Increment to the maxspeed (short of MAX_SPEED_ASTEROID) to be used when starting a new board.
SPEED_MISSILE - Static variable in class Units
Speed the missile uses to pursue a ship.
SPEED_MULTIPLIER_EXPLOSION - Static variable in class Units
Multiply this times a shape vertex's distance from the origin to get the outward speed of an explosion fragment.
split(int, RealPixelConverter) - Method in class SpriteAsteroid
Create one or more smaller asteroids from a larger one using inactive asteroids.
Sprite - class Sprite.
The Sprite class defines a game object, including its shape, position, movement and rotation.
Sprite(RealPixelConverter) - Constructor for class Sprite
The Sprite constructor sets everything to 0, except for the fillcolor, which gets randomized.
SpriteAsteroid - class SpriteAsteroid.
Our jagged asteroid sprites, they come in two sizes.
SpriteAsteroid(RealPixelConverter) - Constructor for class SpriteAsteroid
 
SpriteBullet - class SpriteBullet.
 
SpriteBullet(RealPixelConverter) - Constructor for class SpriteBullet
 
SpriteExplosion - class SpriteExplosion.
 
SpriteExplosion(RealPixelConverter) - Constructor for class SpriteExplosion
 
SpriteMissile - class SpriteMissile.
A missile is the kind of "bullet" that the Ufo shoots.
SpriteMissile(RealPixelConverter) - Constructor for class SpriteMissile
 
SpriteShip - class SpriteShip.
The player sprite, controlled by the keyboard.
SpriteShip(RealPixelConverter) - Constructor for class SpriteShip
Constructor sets colors, calls reset().
SpriteUfo - class SpriteUfo.
 
SpriteUfo(RealPixelConverter) - Constructor for class SpriteUfo
 
spritevector - Variable in class AsteroidsGame
The spritevector holds all of the sprites; we walk this array for our updates.
SpriteWall - class SpriteWall.
Use a SpriteWall to visually show when the bounce flag is on, we'll trigger it using the ship.bounce inside AsteroidsGame draw.
SpriteWall(RealPixelConverter) - Constructor for class SpriteWall
 
STARDENSITY - Static variable in class AsteroidsGame
Number of stars per square world unit.
stars - Variable in class AsteroidsGame
Array for background stars
START_ASTEROIDS - Static variable in class AsteroidsGame
Number of asteroids in each wave.
START_MAX_SPEED_UFO - Static variable in class Units
Speed in world units per second.
START_PIXELHEIGHT - Static variable in class Asteroids
Intended size of the start window.
START_PIXELWIDTH - Static variable in class Asteroids
Intended size of the start window.
start() - Method in class Asteroids
Load the sounds by starting a loadThread, also start the main loopThread.
stop() - Method in class Sprite
The stop method sets active to false and turns off the sound.
stop() - Method in class SpriteShip
 
stop() - Method in class SpriteUfo
Turn off the UFO, set ufoPassesLeft to 0.
stop() - Method in class AsteroidsGame
Stop ship, flying saucer, guided missile and associated sounds.
stop() - Method in class Asteroids
Stop the loadThread and the loopThread by setting them to null.
STORM_PAUSE - Static variable in class Units
Number of updates to pause after an old wave of asteroids before a new one.
subtract(Vector2) - Method in class Vector2
 
sum(Vector2, Vector2) - Static method in class Vector2
 

T

thrustersSound - Static variable in class Asteroids
Sound clip for the ship's thrusters firing.
timestep - Variable in class Asteroids
Use this to time how long the updates take.
TIMEUNIT - Static variable in class Units
Seconds between screen updates.
toggleBounce() - Method in class AsteroidsGame
 
toString() - Method in class Vector2
 
transform(double) - Method in class RealPixelConverter
 
transform(Vector2) - Method in class RealPixelConverter
 
transform(Vector2, Vector2) - Method in class RealPixelConverter
 
triedgettingsounds - Static variable in class Asteroids
Leave this flag off until you've finished trying to load the sound.
trueapplet - Variable in class Asteroids
Flag for whether this is being run as a true applet or simply as an application.
TURN_STEP_FAST_SHIP - Static variable in class Units
See TURN_STEP_SLOW.
TURN_STEP_SLOW_SHIP - Static variable in class Units
Size of ship's rotation speed when you hold down the arrow key.
TURN_STEP_THRESHOLD - Static variable in class SpriteShip
How many turn step updates before you shift into fast turning?
turn(double) - Method in class Vector2
 
turnstep() - Method in class SpriteShip
A function that returns the slow or fast TURN_STEP depending on turnstepcount.
turnstepcount - Variable in class SpriteShip
Track how many turn steps you've done on this key press.

U

ufo - Variable in class AsteroidsGame
The flying saucer.
UFO_PASSES - Static variable in class SpriteUfo
Number of times a Ufo gets to cross the screen.
UFO_POINTS - Static variable in class SpriteUfo
Points for shooting a Ufo.
ufoPassesLeft - Variable in class SpriteUfo
The ufo gets a fixed number of passes across the screen.
Units - class Units.
The Units clas is a catch-all for holding a lot of the spatial size, temporal duration, and speed constants used in the Asteroids program.
Units() - Constructor for class Units
 
up - Variable in class SpriteShip
Key flag for up arrow key pressed.
update(Graphics) - Method in class Asteroids
 
update(RealPixelConverter) - Method in class Sprite
The update method can be overloaded by the child sprite.
update(RealPixelConverter) - Method in class SpriteShip
The ship update method rotates the ship if left or right cursor key is down, Fires thrusters if up or down arrow key is down, calls advance and render, counts down the hyperspace counter if ship is in hyperspace.
update(RealPixelConverter) - Method in class SpriteAsteroid
If hit by bullet, kill asteroid and advance score.
update(RealPixelConverter) - Method in class SpriteUfo
 
update(RealPixelConverter) - Method in class SpriteMissile
Move the guided missile and check for collision with ship or bullet.
update(RealPixelConverter) - Method in class SpriteExplosion
 
update(RealPixelConverter) - Method in class SpriteBullet
We'll deactivate a bullet if its lifetime runs out.
update(RealPixelConverter) - Method in class SpriteWall
Do-nothing update method means don't look at other sprites.

V

Vector2 - class Vector2.
A helper class used for pairs of real numbers.
Vector2() - Constructor for class Vector2
 
Vector2(double) - Constructor for class Vector2
 
Vector2(double, double) - Constructor for class Vector2
 
Vector2(Vector2) - Constructor for class Vector2
 
Vector2Colored - class Vector2Colored.
The Vector2Colored class defines a little colored cross, to use for a star
Vector2Colored() - Constructor for class Vector2Colored
 
Vector2Colored(Randomizer, double, double) - Constructor for class Vector2Colored
 
velocity - Variable in class Sprite
The velocity vector.
version - Static variable in class JDK
Can be 0, 1, or 2 for JDK 1.0, 1.1, or 1.2 (also known as JDK 2).

W

wall - Variable in class AsteroidsGame
Have a SpriteWall to show when the bounce is on for the ship.
warpSound - Static variable in class Asteroids
Sound clip for the hyperspace jump.
WIDTH_WORLD - Static variable in class Units
The width of the unchanging real world in which the Asteroids move, the document size, rather than the view size.
widthpixel - Variable in class RealPixelConverter
 
widthpixel() - Method in class RealPixelConverter
 
widthpixel() - Method in class Asteroids
Accessor to the current pixel dimensions of the view.
widthreal - Variable in class RealPixelConverter
 
widthreal() - Method in class RealPixelConverter
 
wrapandbounce() - Method in class Sprite
Handles the wrapping or bouncing.

X

x - Variable in class Vector2
 

Y

y - Variable in class Vector2
 

A B C D E F G H I J K L M N O P R S T U V W X Y