NetDragons New Stock Sells | Will Smith Posters
Games | Free Web Hosting | DVD | Books | Shop | Posters
Google
Name
Password
Save Password?



[-]NetDragons.com
[-]Games
 | [-]24 Hour Games
 |  | [-]Nelzan
 |  |  | [+]Capital Ships
 |  |  | [+]Light Fighters
 |  |  | [+]Medium Fighters
 |  |  | [+]Play It Now!
 |  |  | [+]Player
 |  |  | [+]Forum
 |  |  | [-]Source Code
 |  | [+]Space Frag I
 |  | [+]GNet Server
 |  | [+]About
 |  | [+]Forum
 |  | [+]License
 | [+]Cards of Tridala
 | [+]Flash Games
 | [+]Vagabond's Quest+
 | [+]Vagabond's Quest v.2
 | [+]Projects
[+]NetDragons.com Live!
[+]Reward Center
[+]Software Center
[+]Company Information
[+]Personal Services
[+]Member Directory
[+]Free E-mail
[+]Buy Cool Stuff
[+]Posters
[+]Your Privacy

Class EnemyShips


[ Source | Index | Back to Nelzan ]

public class EnemyShips
extends Object
EnemyShips - controls enemy actions, movement, and painting.

This class downloads, stores, handles, and draws all information dealing with enemy ships that fly around.


Variable Index

 o comp
 o damage
 o dataFile
 o dir
 o fire
 o fireHeight
 o fireX
 o fireY
 o height
 o imgDown
 o imgFire
 o imgNorm
 o imgUp
 o length
 o move
 o myImages
 o r
For Generating Random Numbers
 o shields
 o step
 o subStep
 o type
 o width
 o x
 o y

Constructor Index

 o EnemyShips(Image[], int, Nelzan)
Defines a new class of EnemyShips to be manipulated.

Method Index

 o abs(int)
Returns the distance from zero.
 o buildNew(int)
Build arrays of the correct length so data can be placed inside them.
 o checkDamage(int)
This function checks to see if a ship or its fired weapon are in contact with the player.
 o getFile(int)
Download the level file and loads it into Arrays.
 o getImage(int)
This function determins if the ship's normal, up, or down image should be shown.
 o levelOver()
A Quick Check to see if the level is over.
 o move(int)
Moves the player based on it's movement string.
 o paint(Graphics)
Paints all the enemies on the screen.
 o toInt(String)
Converts a String to an int;
 o update()
Updates enemy location, fire location, and handles collision logic.

Variables

 o type
 private int type[]
 o width
 private int width[]
 o height
 private int height[]
 o shields
 private int shields[]
 o damage
 private int damage[]
 o x
 private int x[]
 o y
 private int y[]
 o move
 private String move[]
 o fire
 private String fire[]
 o imgNorm
 private int imgNorm[]
 o imgFire
 private int imgFire[]
 o imgUp
 private int imgUp[]
 o imgDown
 private int imgDown[]
 o step
 private int step[]
 o subStep
 private int subStep[]
 o fireX
 private int fireX[]
 o fireY
 private int fireY[]
 o fireHeight
 private int fireHeight[]
 o myImages
 private Image myImages[]
 o comp
 private Nelzan comp
 o dataFile
 private URL dataFile
 o length
 private int length
 o dir
 private int dir
 o r
 Random r
For Generating Random Numbers

Constructors

 o EnemyShips
 EnemyShips(Image img[],
            int level,
            Nelzan c)
Defines a new class of EnemyShips to be manipulated. Will download information from the correct level and store it into private arrays.

Parameters:
img - Images of the ships
level - The current player's Level
c - Instance of Nelzan, for callbacks.

Methods

 o update
 public void update()
Updates enemy location, fire location, and handles collision logic. This function is the brains of all Enemy ships. This updates their location and causes them to move, updates their fire location, and it makes sure the ship or it's weapon is not in contact with the player.

 o levelOver
 public boolean levelOver()
A Quick Check to see if the level is over.

Returns:
true if all members are destoryed, fasle otherwise.
 o paint
 public void paint(Graphics g)
Paints all the enemies on the screen. There is no Z-ordering done in this function, ships are drawn in the order they presented in the array.

Parameters:
g - The Graphics to draw to.
 o checkDamage
 private void checkDamage(int i)
This function checks to see if a ship or its fired weapon are in contact with the player. It also check to see if the players weapon is hitting the ship via a callback. If the ship shiels are less than or equal to zero the ship is destoryed.

Parameters:
i - Array index to check at.
 o getImage
 private int getImage(int i)
This function determins if the ship's normal, up, or down image should be shown.

Parameters:
i - Array index to get Image at.
Returns:
int with the location of the image to be shown.
 o move
 private void move(int i)
Moves the player based on it's movement string.

Parameters:
i - Array index to move.
 o getFile
 private void getFile(int i)
Download the level file and loads it into Arrays.

Parameters:
i - Level to be loaded
 o buildNew
 private void buildNew(int i)
Build arrays of the correct length so data can be placed inside them.

Parameters:
i - Length arrays need to be.
 o toInt
 private int toInt(String s)
Converts a String to an int;

Parameters:
s - The String to be converted
Returns:
an int value from s
 o abs
 private int abs(int i)
Returns the distance from zero.

Parameters:
i - The number to check.
Returns:
s an int of the distance from zero.
ND: VQ+, Mail, Shop, Free Web Hosting Peter Pan Posters

New Stock Buys
Copyrighted �, 2000, 2001 by NetDragons.com
Last Updated Saturday, December 5, 1998 - 20:38 EST