Index

A B C D E G I L M P R S T U X Y 
All Classes|All Packages

A

actionPerformed(ActionEvent) - Method in class Player.LeftPressed
 
actionPerformed(ActionEvent) - Method in class Player.LeftReleased
 
actionPerformed(ActionEvent) - Method in class Player.RightPressed
 
actionPerformed(ActionEvent) - Method in class Player.RightReleased
 
actionPerformed(ActionEvent) - Method in class Player.SpacePressed
 
actionPerformed(ActionEvent) - Method in class Player.SpaceReleased
 
actionPerformed(ActionEvent) - Method in class Player.UpPressed
 
actionPerformed(ActionEvent) - Method in class Player.UpReleased
 
addAlien(Alien) - Method in class GameController
Add an alien spaceship to the game
addAlienBullet(Bullet) - Method in class GameController
Add an alien bullet to game when alien shoots
addAsteroids(BigAsteroid[]) - Method in class GameController
Add multiple asteroids to game This method takes advantage of polymorphism to add big, medium, and small asteroids as both medium and small asteroids inherit from big asteroid class so can be treated as the same data type
addBullet(Bullet) - Method in class GameController
Add a bullet to game when player shoots
addGameFrame(GameFrame) - Method in class GameController
Gives game controller access to game frame
addPlayer(Player) - Method in class GameController
Add player to game window
addToPanel(JComponent[]) - Method in class GameFrame
Adds a component to be drawn on the game panel This method uses Polymorphism to allow all game objects to be handled by one method as they are all descendents of JComponent
Alien - Class in <Unnamed>
 
Alien(double, double) - Constructor for class Alien
 
Animation - Class in <Unnamed>
 
Animation(double, double, String) - Constructor for class Animation
 
Asteroids - Class in <Unnamed>
Asteroids.java - A clone of classic Atari arcade game Asteroids Algorithm: Create gamecontroller with public scope to give all objects access Load images and highscore, exit if error occurs Create game main menu with start and exit options If player selects exit skip to If player selects start clear menu and make game window Create three starting asteroids in game Put player at middle of screen Player turns with left and right, moves with up, and shoots with space Check all bullets for collisions with asteroids, skip to step if none Destroy bullet and asteroid and increment score Check all bullets for collisions with player, skip to step if none Destroy bullet and player and decrement lives Check all asteroids for collisions with player, skip to step if none Destroy asteroid and player and decrement lives If player lives reach zero, display game over message and return to step 3, updating highscore if necessary If player lives above zero, return to step 9 Save high scores and terminate program
Asteroids() - Constructor for class Asteroids
 

B

BigAsteroid - Class in <Unnamed>
BigAsteroid.java - A class to represent a large asteroid
BigAsteroid() - Constructor for class BigAsteroid
No-args Constructor sets direction of movement and image to random value This constructor is meant to be called by subclasses to inherit direction
BigAsteroid(double, double) - Constructor for class BigAsteroid
Full Constructor sets location of asteroid
Bullet - Class in <Unnamed>
Bullet.java - A bullet shot by the player\
Bullet(double, double, double, int, boolean) - Constructor for class Bullet
 

C

CANVAS_HEIGHT - Static variable in class Asteroids
 
CANVAS_WIDTH - Static variable in class Asteroids
 
clearGame() - Method in class GameFrame
Purges game window to prevent unexpected behavior
clearMenu() - Method in class GameFrame
Purges game window to prevent unexpected behavior

D

destroy() - Method in class Alien
 
destroy() - Method in class BigAsteroid
Destroys object
destroy() - Method in class Bullet
Destroy bullet
destroy() - Method in class GamePiece
 
destroy() - Method in class MediumAsteroid
Destroys object
destroy() - Method in class Player
Destroys this object, disabling it permanently
destroy() - Method in class SmallAsteroid
Destroys object
distanceTo(GamePiece) - Method in class GamePiece
Returns the distance to another GamePiece

E

endGame() - Method in class GameController
Execute ending game procedures
equals(Object) - Method in class BigAsteroid
Compares this object to another
equals(Object) - Method in class Bullet
Compares this object to another
exitGame() - Method in class GameController
Execute exit game procedures This method involves text-file output

G

GameController - Class in <Unnamed>
GameController.java - A class to control flow of asteroids game
GameController() - Constructor for class GameController
Constructor initializes arraylists to hold game objects, as well as score and lives
GameFrame - Class in <Unnamed>
GameFrame.java - A class to generate game window and handle GUI
GameFrame() - Constructor for class GameFrame
Constructor initializes JFrame attributes and retrieves images from game controller
GameOverMessage - Class in <Unnamed>
GameOverMessage.java - A class to display game over message at end of game
GameOverMessage(double, double, int) - Constructor for class GameOverMessage
Constructor sets coordinates and final score
GamePanel - Class in <Unnamed>
 
GamePanel(int, int, GameController) - Constructor for class GamePanel
 
GamePiece - Class in <Unnamed>
GamePiece.java - An abstract class used to build all game pieces in game
GamePiece() - Constructor for class GamePiece
 
gc - Static variable in class Asteroids
 
getAlienAnimation() - Method in class GameController
Returns alien spaceship animation sprite
getAnimationImage() - Method in class GamePiece
 
getAsteroidDestroyedImage() - Method in class GameController
Returns asteroid destroy animation
getBigAsteroidImage() - Method in class GameController
Returns big asteroid sprite
getBulletImage() - Method in class GameController
Returns bullet sprite
getCenter() - Method in class Alien
 
getCenter() - Method in class BigAsteroid
Returns center of object
getCenter() - Method in class Bullet
Returns double array representing center of object
getCenter() - Method in class GamePiece
 
getCenter() - Method in class Player
Returns double array holding x and y coordinates of ship center
getDirection() - Method in class BigAsteroid
Returns direction of trave;
getDirection() - Method in class Bullet
Returns this objects direction
getExitButtonImage() - Method in class GameController
Returns exit button image
getHighscore() - Method in class GameController
Return current highscore
getImage() - Method in class GamePiece
Returns original image of sprite
getMaskRadius() - Method in class Alien
 
getMaskRadius() - Method in class BigAsteroid
Returns the radius of collision mask
getMaskRadius() - Method in class Bullet
Returns radius of collision mask
getMaskRadius() - Method in class GamePiece
 
getMaskRadius() - Method in class Player
Returns radius of mask to be used in collision checking
getMaskRadius() - Method in class SmallAsteroid
Returns the radius of collision mask
getMediumAsteroidImage() - Method in class GameController
Returns medium asteroid sprite
getPlayer() - Method in class GameController
 
getPlayerDestroyedImage() - Method in class GameController
Returns player destroyed animation
getPlayerImage() - Method in class GameController
Returns player sprite
getRotatedImage() - Method in class GamePiece
Returns rotated image of sprite
getSmallAsteroidImage() - Method in class GameController
Returns small asteroid sprite
getSpeed() - Method in class BigAsteroid
Returns speed
getSpeed() - Method in class Bullet
Returns this objects speed
getStartButtonImage() - Method in class GameController
Returns start button image
goToMenu(int) - Method in class GameFrame
Setup window to display main menu

I

isCollidingWith(GamePiece) - Method in class GamePiece
Returns true if this object is colliding with another GamePiece
isEnabled() - Method in class Alien
 
isEnabled() - Method in class BigAsteroid
Returns if object is enabled
isEnabled() - Method in class Bullet
Returns if object is enabled
isEnabled() - Method in class MediumAsteroid
Return if object is enabled
isEnabled() - Method in class Player
Returns if this object is in an enabled state
isEnabled() - Method in class SmallAsteroid
Return if object is enabled
isInvulnerable() - Method in class Player
Returns if this object is invulnerable

L

LeftPressed() - Constructor for class Player.LeftPressed
 
LeftReleased() - Constructor for class Player.LeftReleased
 
loadHighscore() - Method in class GameController
Load current highscore from file
loadImages() - Method in class GameController
Load images for game object sprites

M

main(String[]) - Static method in class Asteroids
 
MediumAsteroid - Class in <Unnamed>
MediumAsteroid.java - A class to represent a medium asteroid
MediumAsteroid(double, double) - Constructor for class MediumAsteroid
Full constructor sets location, speed and image
move() - Method in class Alien
 
move() - Method in class BigAsteroid
Move object based on direction and speed
move() - Method in class Bullet
Move bullet based on direction and speed
move() - Method in class GamePiece
 
move() - Method in class Player
Move ship based on momentum vector

P

paintComponent(Graphics) - Method in class Alien
 
paintComponent(Graphics) - Method in class Animation
 
paintComponent(Graphics) - Method in class BigAsteroid
Paints asteroid on graphics canvas
paintComponent(Graphics) - Method in class Bullet
Paint the object on the graphics canvas
paintComponent(Graphics) - Method in class GameOverMessage
Paints component on graphics canvas
paintComponent(Graphics) - Method in class Player
Paints component on graphics canvas
Player - Class in <Unnamed>
Player.java - A ship for the player to manipulate during game
Player(double, double) - Constructor for class Player
Constructor takes player's x and y coordinates in the game window
Player.LeftPressed - Class in <Unnamed>
An inner class to respond to left arrow keyboard input (Pressing)
Player.LeftReleased - Class in <Unnamed>
An inner class to respond to left arrow keyboard input (Releasing)
Player.RightPressed - Class in <Unnamed>
An inner class to respond to right arrow keyboard input (Pressing)
Player.RightReleased - Class in <Unnamed>
An inner class to respond to right arrow keyboard input (Releasing)
Player.SpacePressed - Class in <Unnamed>
An inner class to respond to space keyboard input (Pressing)
Player.SpaceReleased - Class in <Unnamed>
An inner class to respond to space keyboard input (Releasing)
Player.UpPressed - Class in <Unnamed>
An inner class to respond to up arrow keyboard input (Pressing)
Player.UpReleased - Class in <Unnamed>
An inner class to respond to up arrow keyboard input (Releasing)

R

removeAlien(Alien) - Method in class GameController
 
removeAsteroid(BigAsteroid) - Method in class GameController
Remove an asteroid from the game when it is destroyed This method takes advantage of polymorphism to remove big, medium, and small asteroids as both medium and small asteroids inherit from big asteroid class so can be treated as the same data type
removeBullet(Bullet) - Method in class GameController
Remove a bullet from game when it is destroyed
removeFromPanel(JComponent) - Method in class GameFrame
Removes a component from the game panel This method uses Polymorphism to allow all game objects to be handled by one method as they are all descendents of JComponent
removePlayer() - Method in class GameController
Remove a player from the screen when ship is destroyed
respawn() - Method in class Player
Temporarily disables object, respawning it at center of screen
returnToMenu() - Method in class GameController
Tells game window to set up menu and updates highscore
RightPressed() - Constructor for class Player.RightPressed
 
RightReleased() - Constructor for class Player.RightReleased
 
rotateImage() - Method in class BigAsteroid
Rotates the sprite image
rotateImage() - Method in class Player
Rotate image based on ship heading

S

screenWrap() - Method in class Alien
Wraps bullet around screen if it exceeds game window boundaries
screenWrap() - Method in class BigAsteroid
Wraps bullet around screen if it exceeds game window boundaries
screenWrap() - Method in class Bullet
Wraps bullet around screen if it exceeds game window boundaries
screenWrap() - Method in class Player
Wrap ship around screen if window boundaries are exceeded
setAnimationImage(Image) - Method in class GamePiece
 
setDirection(double) - Method in class BigAsteroid
Sets direction
setImage(BufferedImage) - Method in class GamePiece
Sets the image to be rendered by the game piece
setInvulnerable() - Method in class Player
Set invulnerability for two seconds
setRotatedImage(BufferedImage) - Method in class GamePiece
Sets the rotated image to be rendered in specific rotation
setSpeed(double) - Method in class BigAsteroid
Sets speed
shoot() - Method in class Alien
 
shoot() - Method in class Player
Creat a bullet that travels in direction ship is currently facing
SmallAsteroid - Class in <Unnamed>
SmallAsteroid.java - A class to represent a small asteroid
SmallAsteroid(double, double) - Constructor for class SmallAsteroid
Full constructor sets coordinates, speed, and loads images
SpacePressed() - Constructor for class Player.SpacePressed
 
SpaceReleased() - Constructor for class Player.SpaceReleased
 
startAlienTimer() - Method in class GameController
 
startAsteroidTimer() - Method in class GameController
Starts timer that adds new asteroids to game periodically
startGame() - Method in class GameController
Tells window to set up game window and sets up all game pieces
startGame() - Method in class GameFrame
Setup window to display game
startGameTimer() - Method in class GameController
Start timer to control game from frame to frame

T

tick() - Method in class Alien
 
tick() - Method in class BigAsteroid
Update object every frame
tick() - Method in class Bullet
Update player each frame
tick() - Method in class GameFrame
Updates game panel to show new state
tick() - Method in class GamePiece
 
tick() - Method in class Player
Update player each frame
toString() - Method in class Animation
 
toString() - Method in class BigAsteroid
 
toString() - Method in class Bullet
 

U

updateLives(int) - Method in class GameFrame
Updates lives label in game
updateScore(int) - Method in class GameFrame
Updates score label in game
UpPressed() - Constructor for class Player.UpPressed
 
UpReleased() - Constructor for class Player.UpReleased
 

X

x() - Method in class BigAsteroid
Returns x coordinate
x() - Method in class Bullet
Returns x coordinate of object
x() - Method in class Player
Returns x coordinate
xSet(double) - Method in class BigAsteroid
Sets x coordinate

Y

y() - Method in class BigAsteroid
Returns y coordinate
y() - Method in class Bullet
Returns y coordinate of objecct
y() - Method in class Player
Returns y coordinate
ySet(double) - Method in class BigAsteroid
Sets y coordinate
A B C D E G I L M P R S T U X Y 
All Classes|All Packages