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

Public Member Functions

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

Private Attributes

int destX
int destY
double speedFactor
boolean soundPlaying
MP3 sound
int prevDist

Additional Inherited Members

- 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 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)
void explodeSprite ()

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 19 of file SpaceshipSprite.java.

Constructor & Destructor Documentation

micropolisj.engine.SpaceshipSprite.SpaceshipSprite ( Micropolis  engine,
int  xpos,
int  ypos 
)

Definition at line 28 of file SpaceshipSprite.java.

Member Function Documentation

void micropolisj.engine.SpaceshipSprite.moveImpl ( )
virtual

For subclasses to override. Actually does the movement and animation of this particular sprite. Setting this.frame to zero will cause the sprite to be unallocated.

Implements micropolisj.engine.Sprite.

Definition at line 60 of file SpaceshipSprite.java.

References micropolisj.engine.SpaceshipSprite.destX, micropolisj.engine.SpaceshipSprite.destY, micropolisj.util.MP3.play(), micropolisj.engine.SpaceshipSprite.prevDist, micropolisj.engine.SpaceshipSprite.sound, micropolisj.engine.SpaceshipSprite.soundPlaying, micropolisj.engine.Sound.SPACESHIP_LAUNCH, micropolisj.engine.SpaceshipSprite.speedFactor, micropolisj.engine.Sprite.x, and micropolisj.engine.Sprite.y.

Here is the call graph for this function:

Member Data Documentation

int micropolisj.engine.SpaceshipSprite.destX
private
int micropolisj.engine.SpaceshipSprite.destY
private
int micropolisj.engine.SpaceshipSprite.prevDist
private
MP3 micropolisj.engine.SpaceshipSprite.sound
private

Definition at line 24 of file SpaceshipSprite.java.

Referenced by micropolisj.engine.SpaceshipSprite.moveImpl().

boolean micropolisj.engine.SpaceshipSprite.soundPlaying
private
double micropolisj.engine.SpaceshipSprite.speedFactor
private

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