tipgame.game.gammacentauri
Class GammaCentauriLoop

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by tipgame.GameWindow
                          extended by tipgame.FrameAdvancer
                              extended by tipgame.GameLoop
                                  extended by tipgame.game.gammacentauri.GammaCentauriLoop
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowStateListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer

public class GammaCentauriLoop
extends tipgame.GameLoop

The loop that powers Gamma Centauri.

Author:
Tom James
See Also:
Serialized Form

Nested Class Summary
(package private)  class GammaCentauriLoop.auxProcess
          Implements the methods that are required for each level.
(package private)  class GammaCentauriLoop.StartSideMovement
          Used to move the enemies when they get to the side of the screen.
(package private)  class GammaCentauriLoop.TimeUpdater
          Updates the timer every second.
 
Nested classes/interfaces inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean[] alive
          The array that stores whether each player is alive or not.
static double BONUS_MULTIPLIER
          The number of points awarded to the player for each second under 60 times the wave number in which the wave is completed.
private  tipgame.Sprite[][] bullet
          The player bullets.
static double BULLET_SPEED_UPGRADE_MAGNITUDE
          The amount by which a player's bullet speed is increased when a bullet speed upgrade is attained.
private  tipgame.game.gammacentauri.tracker.BulletTracker[][] bulletTracker
          The player bullet trackers.
 double[] bulletVelocity
          The array that holds the players' bullet velocities.
private static java.net.URL CLIP_FILE
          The location of the sound to be played when an enemy is killed.
private static java.net.URL CLIP_FILE2
          The location of the sound to be played when the player gets an upgrade.
private static java.net.URL CLIP_FILE3
          The location of the sound to be played in between levels.
private  int[] currentBullet
          The current bullet that the player is firing.
private  int[] currentBulletCount
          The current amount of bullets that the player can have on the screen at one time.
private  long desiredScore
          The score required to clear each wave.
static tipgame.Sprite[][] enemy
          The enemy sprites.
static java.awt.geom.Rectangle2D.Double ENEMY_BOX
          The location and size of the box that defines the enemies' positions.
static double ENEMY_BULLET_VELOCITY
          The velocity of the enemies' bullets.
static double ENEMY_BULLET_WIDTH
          The width of the enemies' bullets.
static double ENEMY_HORIZONTAL_VELOCITY
          The horizontal velocity of the enemies' ships.
static double ENEMY_MOVE_DOWN_TIME
          The number of seconds that the enemies move down for each time one of them hits the edge of the screen.
static double ENEMY_SHOOT_PROBABILITY
          The probability that an enemy will shoot every time frame.
static int ENEMY_TYPE_ONE_HEALTH
          The amount of damage an enemy of type one can sustain before being killed.
static double ENEMY_TYPE_ONE_POINTS
          The number of points awarded to the player for killing an enemy of type one.
static double ENEMY_TYPE_THREE_BULLET_VELOCITY
          The velocity of the bullets of enemies of type three.
static int ENEMY_TYPE_THREE_HEALTH
          The amount of damage an enemy of type three can sustain before being killed.
static double ENEMY_TYPE_THREE_POINTS
          The number of points awarded to the player for killing an enemy of type three.
static int ENEMY_TYPE_TWO_HEALTH
          The amount of damage an enemy of type two can sustain before being killed.
static double ENEMY_TYPE_TWO_POINTS
          The number of points awarded to the player for killing an enemy of type two.
static double ENEMY_VERTICAL_VELOCITY
          The vertical velocity of the enemies' ships.
static double ENEMY_WIDTH
          The width of the enemies' ships.
private  tipgame.Sprite[][] enemyBullet
          The enemy bullets.
private  tipgame.game.gammacentauri.tracker.EnemyBulletTracker[][] enemyBulletTracker
          The enemy bullet trackers.
private  int[][][] enemyGrid
          The grid used to define enemy types and locations on the screen.
private  int[][] enemyHealth
          The health of the enemies.
static tipgame.game.gammacentauri.tracker.EnemyTracker[][] enemyTracker
          The enemy trackers.
private static double EPSILON
          Used to combat round-off errors.
(package private)  java.applet.AudioClip impactClip
          The sound to be played when an enemy is killed.
private  boolean inBetweenLevels
          Whether or not the player is currently in between waves.
static double INITAL_BULLET_VELOCITY
          The initial velocity of the players' bullets.
static int INITIAL_BULLET_COUNT
          The maximum number of bullets the player can have on the screen at one time.
private  int[] laserDamage
          The damage the player's laser deals to the enemies.
static double LEVEL_DELAY
          The time (in seconds) in between levels.
(package private)  java.applet.AudioClip levelClip
          The sound to be played in between levels.
static int MAX_BULLET_COUNT
          The maximum number of bullets the player can have on the screen at one time.
static double MAX_VELOCITY
          The maximum velocity of the player's ship.
(package private)  java.applet.AudioClip moneyClip
          The sound to be played when the player gets an upgrade.
static int NUM_POSSIBLE_UPGRADES
          The number of upgrades that are attainable.
static double PAR_TIME_PER_LEVEL
          The number of seconds at which the player receieves no bonus points for completing the wave.
static double PLAYER_BULLET_WIDTH
          The width of the player's bullets.
private  long[] score
          The player's current score.
static java.awt.geom.Point2D.Double SCORE_LOCATION
          The location of the score.
static double SCORE_SIZE_X
          The width of the score.
private  tipgame.sprite.StringSprite scoreSprite
          The sprite for the player's current score.
static int SHIELD_UPGRADE_MAGNITUDE
          The amount by which the player's shields are increased when getting a shield upgrade.
private  int[] shields
          The player's current shields.
static java.awt.geom.Point2D.Double SHIELDS_LOCATION
          The location of the shields.
static double SHIELDS_SIZE_X
          The width of the shields sprite.
private  tipgame.sprite.StringSprite shieldsSprite
          The sprite for the player's current shields.
static tipgame.Sprite[] ship
          The ship sprites.
static double SHIP_SIDE_LENGTH
          The side length of the player's ship.
static java.awt.geom.Point2D.Double SHIP_START
          The starting location of the player's ship.
private  tipgame.game.gammacentauri.tracker.ShipTracker[] shipTracker
          The ship trackers.
private  boolean[] spread
          The array that stores whether each player has the spread shot upgrade or not.
static int STARTING_LASER_DAMAGE
          The amount of damage the player's laser does at the start of the game.
static int STARTING_SHIELDS
          The amount of shields each player starts with.
private  double timeOffset
          Used to reset the timer when the game is restarted.
private  tipgame.sprite.StringSprite timer
          The timer sprite.
static java.awt.geom.Point2D.Double TIMER_LOCATION
          The location of the timer.
static double TIMER_SIZE_X
          The width of the timer.
private  tipgame.Sprite[][] upgrade
          The upgrade sprites.
static double UPGRADE_DROP_PROBABILITY
          The probability that an upgrade will drop when an enemy is killed.
static double UPGRADE_VELOCITY
          The velocity of the upgrades.
static double UPGRADE_WIDTH
          The width of the upgrades.
private  int[][] upgradeGrid
          The array that stores the upgrades hidden within the enemies.
private  tipgame.game.gammacentauri.tracker.EnemyBulletTracker[][] upgradeTracker
          The upgrade trackers.
private  int wave
          The current wave the player is on.
static java.awt.geom.Point2D.Double WAVE_LOCATION
          The location of the wave indicator.
static double WAVE_SIZE_X
          The width of the wave indicator sprite.
private  tipgame.sprite.StringSprite waveSprite
          The wave indicator sprite.
 
Fields inherited from class tipgame.GameLoop
messages, playerKeyboard, playerMouse, random, SEED
 
Fields inherited from class tipgame.FrameAdvancer
canvas, timeInterval
 
Fields inherited from class tipgame.GameWindow
frame, gameLoop, hasFrame, help
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GammaCentauriLoop()
          Constructs the game.
 
Method Summary
 void addBullets()
          Adds each bullet to the canvas.
 void addEnemies()
          Adds the enemy sprites to the canvas.
 void addEnemyBullets()
          Adds the enemy bullet sprites to the canvas.
private  void addScore()
          Adds the score to the canvas.
private  void addShields()
          Adds the shields sprite to the canvas.
 void addShips()
          Adds each ship to the canvas.
private  void addTimer()
          Adds the timer to the canvas.
 void addUpgrades()
          Adds the upgrade sprites to the canvas.
private  void addWave()
          Adds the wave indicator to the canvas.
 void advanceFrame()
          called repeatedly between every model update
 void advanceLevel()
          Advances to the next wave.
 void checkEnemyBullets()
          Checks the position of each enemy bullet and resets it if it goes off the canvas.
 void checkWin()
          Checks to see if the player has enough points to advance to the next level.
 void fireBullets()
          Fires a bullet if the player presses "/" and the player has bullets remaining.
 void fireEnemyBullets()
          Fires all of the enemy bullets that need to be fired.
protected  java.net.URL getHelpURL()
          this method must be overridden when extending the GameWindow.
 void giveBonusPoints()
          Gives bonus points to the player based on the time it took to complete the wave.
 void handleCollisions()
          Handles collisions between player bullets and enemies and between enemy bullets and the players.
 void makeBullets()
          Creates a number of bullets for each player equal to MAX_BULLET_COUNT.
 void makeBulletTrackers()
          Creates a tracker for each bullet.
 void makeEnemies()
          Creates enemies by reading enemyGrid[][][].
 void makeEnemyBullets()
          Creates a bullet for each enemy.
 void makeEnemyBulletTrackers()
          Creates a bullet tracker for each enemy bullet.
 void makeEnemyHealth()
          Assigns the appropriate amount of health to each enemy.
 void makeEnemyTrackers()
          Creates a tracker for each enemy.
private  void makeScore()
          Creates the string sprite and sets its scale and location.
private  void makeShields()
          Creates the shields sprite and sets its scale and location.
 void makeShips()
          Creates a ship for each player and sets its scale, location, and color.
 void makeShipTrackers()
          Creates a tracker for each ship.
private  void makeSoundClips()
          Creates the sounds clips.
private  void makeTimer()
          Creates the timer sprite and sets its scale and location.
 void makeUpgradeGrid()
          Constructs the grid that holds the upgrades hidden within each enemy.
 void makeUpgrades()
          Creates the upgrade sprites.
 void makeUpgradeTrackers()
          Creates the upgrade trackers.
private  void makeWave()
          Creates the wave indicator sprite and sets its scale and location.
 void moveEnemies()
          Changes the velocity of all of the enemies if one of them hits an edge of ENEMY_BOX.
 void moveShips()
          Changes the velocity of each ship based on the keyboard input.
 void startGame()
          starts game
 
Methods inherited from class tipgame.GameLoop
connect, disconnect, getID, isMuted, isPaused, pauseToggle, postAdvanceFrame, sendMessage, setGameName, setNumberOfPlayers, setServerName, setSessionName, start, toggleAudible
 
Methods inherited from class tipgame.FrameAdvancer
cancelAlarm, clearAllAlarms, getCanvas, getScreenRefreshRate, getTime, refreshScreen, scheduleAbsolute, scheduleRelative, setCanvas, setMinimumModelFrameRate, updateModel
 
Methods inherited from class tipgame.GameWindow
actionPerformed, getDefaultSize, init, runAsApplication, setTitle, setUseFrame, stop, windowStateChanged
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EPSILON

private static final double EPSILON
Used to combat round-off errors.

See Also:
Constant Field Values

SHIP_SIDE_LENGTH

public static final double SHIP_SIDE_LENGTH
The side length of the player's ship.

See Also:
Constant Field Values

STARTING_SHIELDS

public static final int STARTING_SHIELDS
The amount of shields each player starts with.

See Also:
Constant Field Values

STARTING_LASER_DAMAGE

public static final int STARTING_LASER_DAMAGE
The amount of damage the player's laser does at the start of the game.

See Also:
Constant Field Values

UPGRADE_WIDTH

public static final double UPGRADE_WIDTH
The width of the upgrades.

See Also:
Constant Field Values

SHIP_START

public static final java.awt.geom.Point2D.Double SHIP_START
The starting location of the player's ship.


MAX_VELOCITY

public static final double MAX_VELOCITY
The maximum velocity of the player's ship.

See Also:
Constant Field Values

UPGRADE_VELOCITY

public static final double UPGRADE_VELOCITY
The velocity of the upgrades.

See Also:
Constant Field Values

MAX_BULLET_COUNT

public static final int MAX_BULLET_COUNT
The maximum number of bullets the player can have on the screen at one time.

See Also:
Constant Field Values

INITIAL_BULLET_COUNT

public static final int INITIAL_BULLET_COUNT
The maximum number of bullets the player can have on the screen at one time.

See Also:
Constant Field Values

PLAYER_BULLET_WIDTH

public static final double PLAYER_BULLET_WIDTH
The width of the player's bullets.

See Also:
Constant Field Values

ENEMY_BULLET_WIDTH

public static final double ENEMY_BULLET_WIDTH
The width of the enemies' bullets.

See Also:
Constant Field Values

INITAL_BULLET_VELOCITY

public static final double INITAL_BULLET_VELOCITY
The initial velocity of the players' bullets.

See Also:
Constant Field Values

bulletVelocity

public double[] bulletVelocity
The array that holds the players' bullet velocities.


ENEMY_BULLET_VELOCITY

public static final double ENEMY_BULLET_VELOCITY
The velocity of the enemies' bullets.

See Also:
Constant Field Values

ENEMY_BOX

public static final java.awt.geom.Rectangle2D.Double ENEMY_BOX
The location and size of the box that defines the enemies' positions.


ENEMY_WIDTH

public static final double ENEMY_WIDTH
The width of the enemies' ships.

See Also:
Constant Field Values

ENEMY_MOVE_DOWN_TIME

public static final double ENEMY_MOVE_DOWN_TIME
The number of seconds that the enemies move down for each time one of them hits the edge of the screen.

See Also:
Constant Field Values

ENEMY_VERTICAL_VELOCITY

public static final double ENEMY_VERTICAL_VELOCITY
The vertical velocity of the enemies' ships.

See Also:
Constant Field Values

ENEMY_HORIZONTAL_VELOCITY

public static final double ENEMY_HORIZONTAL_VELOCITY
The horizontal velocity of the enemies' ships.

See Also:
Constant Field Values

ENEMY_SHOOT_PROBABILITY

public static final double ENEMY_SHOOT_PROBABILITY
The probability that an enemy will shoot every time frame.

See Also:
Constant Field Values

ENEMY_TYPE_THREE_BULLET_VELOCITY

public static final double ENEMY_TYPE_THREE_BULLET_VELOCITY
The velocity of the bullets of enemies of type three.

See Also:
Constant Field Values

ENEMY_TYPE_ONE_POINTS

public static final double ENEMY_TYPE_ONE_POINTS
The number of points awarded to the player for killing an enemy of type one.

See Also:
Constant Field Values

ENEMY_TYPE_TWO_POINTS

public static final double ENEMY_TYPE_TWO_POINTS
The number of points awarded to the player for killing an enemy of type two.

See Also:
Constant Field Values

ENEMY_TYPE_THREE_POINTS

public static final double ENEMY_TYPE_THREE_POINTS
The number of points awarded to the player for killing an enemy of type three.

See Also:
Constant Field Values

PAR_TIME_PER_LEVEL

public static final double PAR_TIME_PER_LEVEL
The number of seconds at which the player receieves no bonus points for completing the wave.

See Also:
Constant Field Values

BONUS_MULTIPLIER

public static final double BONUS_MULTIPLIER
The number of points awarded to the player for each second under 60 times the wave number in which the wave is completed.

See Also:
Constant Field Values

ENEMY_TYPE_ONE_HEALTH

public static final int ENEMY_TYPE_ONE_HEALTH
The amount of damage an enemy of type one can sustain before being killed.

See Also:
Constant Field Values

ENEMY_TYPE_TWO_HEALTH

public static final int ENEMY_TYPE_TWO_HEALTH
The amount of damage an enemy of type two can sustain before being killed.

See Also:
Constant Field Values

ENEMY_TYPE_THREE_HEALTH

public static final int ENEMY_TYPE_THREE_HEALTH
The amount of damage an enemy of type three can sustain before being killed.

See Also:
Constant Field Values

TIMER_LOCATION

public static final java.awt.geom.Point2D.Double TIMER_LOCATION
The location of the timer.


TIMER_SIZE_X

public static final double TIMER_SIZE_X
The width of the timer.

See Also:
Constant Field Values

SCORE_LOCATION

public static final java.awt.geom.Point2D.Double SCORE_LOCATION
The location of the score.


SCORE_SIZE_X

public static final double SCORE_SIZE_X
The width of the score.

See Also:
Constant Field Values

SHIELDS_LOCATION

public static final java.awt.geom.Point2D.Double SHIELDS_LOCATION
The location of the shields.


SHIELDS_SIZE_X

public static final double SHIELDS_SIZE_X
The width of the shields sprite.

See Also:
Constant Field Values

WAVE_LOCATION

public static final java.awt.geom.Point2D.Double WAVE_LOCATION
The location of the wave indicator.


WAVE_SIZE_X

public static final double WAVE_SIZE_X
The width of the wave indicator sprite.

See Also:
Constant Field Values

LEVEL_DELAY

public static final double LEVEL_DELAY
The time (in seconds) in between levels.

See Also:
Constant Field Values

BULLET_SPEED_UPGRADE_MAGNITUDE

public static final double BULLET_SPEED_UPGRADE_MAGNITUDE
The amount by which a player's bullet speed is increased when a bullet speed upgrade is attained.

See Also:
Constant Field Values

NUM_POSSIBLE_UPGRADES

public static final int NUM_POSSIBLE_UPGRADES
The number of upgrades that are attainable.

See Also:
Constant Field Values

UPGRADE_DROP_PROBABILITY

public static final double UPGRADE_DROP_PROBABILITY
The probability that an upgrade will drop when an enemy is killed.

See Also:
Constant Field Values

SHIELD_UPGRADE_MAGNITUDE

public static final int SHIELD_UPGRADE_MAGNITUDE
The amount by which the player's shields are increased when getting a shield upgrade.

See Also:
Constant Field Values

CLIP_FILE

private static final java.net.URL CLIP_FILE
The location of the sound to be played when an enemy is killed.


CLIP_FILE2

private static final java.net.URL CLIP_FILE2
The location of the sound to be played when the player gets an upgrade.


CLIP_FILE3

private static final java.net.URL CLIP_FILE3
The location of the sound to be played in between levels.


scoreSprite

private tipgame.sprite.StringSprite scoreSprite
The sprite for the player's current score.


shieldsSprite

private tipgame.sprite.StringSprite shieldsSprite
The sprite for the player's current shields.


shields

private int[] shields
The player's current shields.


score

private long[] score
The player's current score.


desiredScore

private long desiredScore
The score required to clear each wave.


inBetweenLevels

private boolean inBetweenLevels
Whether or not the player is currently in between waves.


wave

private int wave
The current wave the player is on.


currentBulletCount

private int[] currentBulletCount
The current amount of bullets that the player can have on the screen at one time.


timeOffset

private double timeOffset
Used to reset the timer when the game is restarted.


laserDamage

private int[] laserDamage
The damage the player's laser deals to the enemies.


impactClip

java.applet.AudioClip impactClip
The sound to be played when an enemy is killed.


moneyClip

java.applet.AudioClip moneyClip
The sound to be played when the player gets an upgrade.


levelClip

java.applet.AudioClip levelClip
The sound to be played in between levels.


timer

private tipgame.sprite.StringSprite timer
The timer sprite.


waveSprite

private tipgame.sprite.StringSprite waveSprite
The wave indicator sprite.


ship

public static tipgame.Sprite[] ship
The ship sprites.


shipTracker

private tipgame.game.gammacentauri.tracker.ShipTracker[] shipTracker
The ship trackers.


bullet

private tipgame.Sprite[][] bullet
The player bullets.


bulletTracker

private tipgame.game.gammacentauri.tracker.BulletTracker[][] bulletTracker
The player bullet trackers.


currentBullet

private int[] currentBullet
The current bullet that the player is firing.


enemyGrid

private int[][][] enemyGrid
The grid used to define enemy types and locations on the screen.


enemy

public static tipgame.Sprite[][] enemy
The enemy sprites.


enemyTracker

public static tipgame.game.gammacentauri.tracker.EnemyTracker[][] enemyTracker
The enemy trackers.


enemyBullet

private tipgame.Sprite[][] enemyBullet
The enemy bullets.


enemyHealth

private int[][] enemyHealth
The health of the enemies.


enemyBulletTracker

private tipgame.game.gammacentauri.tracker.EnemyBulletTracker[][] enemyBulletTracker
The enemy bullet trackers.


upgradeGrid

private int[][] upgradeGrid
The array that stores the upgrades hidden within the enemies.


upgrade

private tipgame.Sprite[][] upgrade
The upgrade sprites.


upgradeTracker

private tipgame.game.gammacentauri.tracker.EnemyBulletTracker[][] upgradeTracker
The upgrade trackers.


alive

private boolean[] alive
The array that stores whether each player is alive or not.


spread

private boolean[] spread
The array that stores whether each player has the spread shot upgrade or not.

Constructor Detail

GammaCentauriLoop

public GammaCentauriLoop()
Constructs the game.

Method Detail

startGame

public void startGame()
Description copied from class: tipgame.GameLoop
starts game

Overrides:
startGame in class tipgame.GameLoop

makeTimer

private void makeTimer()
Creates the timer sprite and sets its scale and location.


addTimer

private void addTimer()
Adds the timer to the canvas.


makeShields

private void makeShields()
Creates the shields sprite and sets its scale and location.


addShields

private void addShields()
Adds the shields sprite to the canvas.


makeScore

private void makeScore()
Creates the string sprite and sets its scale and location.


addScore

private void addScore()
Adds the score to the canvas.


makeWave

private void makeWave()
Creates the wave indicator sprite and sets its scale and location.


addWave

private void addWave()
Adds the wave indicator to the canvas.


makeSoundClips

private void makeSoundClips()
Creates the sounds clips.


makeShips

public void makeShips()
Creates a ship for each player and sets its scale, location, and color.


makeShipTrackers

public void makeShipTrackers()
Creates a tracker for each ship.


makeBullets

public void makeBullets()
Creates a number of bullets for each player equal to MAX_BULLET_COUNT.


makeBulletTrackers

public void makeBulletTrackers()
Creates a tracker for each bullet.


addBullets

public void addBullets()
Adds each bullet to the canvas.


addShips

public void addShips()
Adds each ship to the canvas.


moveShips

public void moveShips()
Changes the velocity of each ship based on the keyboard input.


fireBullets

public void fireBullets()
Fires a bullet if the player presses "/" and the player has bullets remaining.


makeEnemyHealth

public void makeEnemyHealth()
Assigns the appropriate amount of health to each enemy.


makeEnemies

public void makeEnemies()
Creates enemies by reading enemyGrid[][][].


makeEnemyTrackers

public void makeEnemyTrackers()
Creates a tracker for each enemy.


makeUpgradeGrid

public void makeUpgradeGrid()
Constructs the grid that holds the upgrades hidden within each enemy.


makeUpgrades

public void makeUpgrades()
Creates the upgrade sprites.


makeUpgradeTrackers

public void makeUpgradeTrackers()
Creates the upgrade trackers.


addUpgrades

public void addUpgrades()
Adds the upgrade sprites to the canvas.


addEnemies

public void addEnemies()
Adds the enemy sprites to the canvas.


addEnemyBullets

public void addEnemyBullets()
Adds the enemy bullet sprites to the canvas.


makeEnemyBullets

public void makeEnemyBullets()
Creates a bullet for each enemy.


makeEnemyBulletTrackers

public void makeEnemyBulletTrackers()
Creates a bullet tracker for each enemy bullet.


fireEnemyBullets

public void fireEnemyBullets()
Fires all of the enemy bullets that need to be fired.


moveEnemies

public void moveEnemies()
Changes the velocity of all of the enemies if one of them hits an edge of ENEMY_BOX.


handleCollisions

public void handleCollisions()
Handles collisions between player bullets and enemies and between enemy bullets and the players.


checkEnemyBullets

public void checkEnemyBullets()
Checks the position of each enemy bullet and resets it if it goes off the canvas.


giveBonusPoints

public void giveBonusPoints()
Gives bonus points to the player based on the time it took to complete the wave.


advanceLevel

public void advanceLevel()
Advances to the next wave.


checkWin

public void checkWin()
Checks to see if the player has enough points to advance to the next level.


advanceFrame

public void advanceFrame()
Description copied from class: tipgame.FrameAdvancer
called repeatedly between every model update

Overrides:
advanceFrame in class tipgame.FrameAdvancer

getHelpURL

protected java.net.URL getHelpURL()
Description copied from class: tipgame.GameWindow
this method must be overridden when extending the GameWindow. A single HTML help file should be placed in tipgame/util/html/your_package_name. This method should return the string:
your_package_name/your_help_file.html

Specified by:
getHelpURL in class tipgame.GameWindow
Returns:
the name of the help file