Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
micropolisj.engine.RocketSprite Class Reference
Inheritance diagram for micropolisj.engine.RocketSprite:
Collaboration diagram for micropolisj.engine.RocketSprite:

Public Member Functions

 RocketSprite (Micropolis engine, int xpos, int ypos, int xDest, int yDest, int ownerID)
 RocketSprite (Micropolis engine, int xpos, int ypos, int xDest, int yDest, double speedFactor, int ownerID)
void moveImpl ()
- Public Member Functions inherited from micropolisj.engine.Sprite
void setMicropolis (Micropolis micro)
final void move ()
final boolean isVisible ()
void remove ()

Static Public Member Functions

static int getDir (int orgX, int orgY, int desX, int desY)

Public Attributes

int ownerID
- Public Attributes inherited from micropolisj.engine.Sprite
SpriteKind kind
int offx
int offy
int width = 32
int height = 32
int frame
int x
int y
int lastX
int lastY

Protected Member Functions

void explodeSprite ()
- Protected Member Functions inherited from micropolisj.engine.Sprite
 Sprite (Micropolis engine, SpriteKind kind)
final int getChar (int x, int y)
int tilePosToPixel (int x)
int pixelToTilePos (int x)

Private Member Functions

void setStart (int x, int y)
void setDestination (int x, int y)
double stepsTilBoom ()

Private Attributes

int destX
int destY
double speedFactor
boolean soundPlaying

Detailed Description

Implements the airplane. The airplane appears if the city contains an airport. It first takes off, then flies around randomly, occassionally crashing.

Definition at line 16 of file RocketSprite.java.

Constructor & Destructor Documentation

micropolisj.engine.RocketSprite.RocketSprite ( Micropolis  engine,
int  xpos,
int  ypos,
int  xDest,
int  yDest,
int  ownerID 
)

Definition at line 33 of file RocketSprite.java.

References micropolisj.engine.RocketSprite.ownerID.

Member Function Documentation

static int micropolisj.engine.RocketSprite.getDir ( int  orgX,
int  orgY,
int  desX,
int  desY 
)
static

Computes direction from one point to another.

Returns
integer between 1 and 8, with 1 == north, 3 == east, 5 == south, 7 == west.

Reimplemented from micropolisj.engine.Sprite.

Definition at line 69 of file RocketSprite.java.

Referenced by micropolisj.engine.RocketSprite.moveImpl(), and micropolisj.engine.RocketSprite.RocketSprite().

void micropolisj.engine.RocketSprite.setDestination ( int  x,
int  y 
)
private
void micropolisj.engine.RocketSprite.setStart ( int  x,
int  y 
)
private

Definition at line 58 of file RocketSprite.java.

References micropolisj.engine.Sprite.tilePosToPixel().

Referenced by micropolisj.engine.RocketSprite.RocketSprite().

Here is the call graph for this function:

Member Data Documentation

int micropolisj.engine.RocketSprite.ownerID
boolean micropolisj.engine.RocketSprite.soundPlaying
private
double micropolisj.engine.RocketSprite.speedFactor
private

The documentation for this class was generated from the following file: