Methapolis
0.27
|
Public Member Functions | |
void | setMicropolis (Micropolis micro) |
final void | move () |
final boolean | isVisible () |
void | remove () |
Public Attributes | |
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 | |
Sprite (Micropolis engine, SpriteKind kind) | |
final int | getChar (int x, int y) |
int | tilePosToPixel (int x) |
int | pixelToTilePos (int x) |
abstract void | moveImpl () |
void | explodeSprite () |
Represents a mobile entity on the city map, such as a tornado or a train. There can be any number present in a city, and each one gets a chance to act on every tick of the simulation.
Definition at line 29 of file Sprite.java.
|
protected |
Definition at line 51 of file Sprite.java.
References micropolisj.engine.Sprite.kind.
|
protected |
Replaces this sprite with an exploding sprite.
Reimplemented in micropolisj.engine.RocketSprite.
Definition at line 146 of file Sprite.java.
References micropolisj.engine.MicropolisMessage.COPTER_CRASH_REPORT, micropolisj.engine.Sound.EXPLOSION_HIGH, micropolisj.engine.Sprite.frame, micropolisj.engine.Sprite.kind, micropolisj.engine.MicropolisMessage.PLANECRASH_REPORT, micropolisj.engine.MicropolisMessage.SHIPWRECK_REPORT, micropolisj.engine.MicropolisMessage.TRAIN_CRASH_REPORT, micropolisj.engine.Sprite.x, and micropolisj.engine.Sprite.y.
Referenced by micropolisj.engine.AirplaneSprite.moveImpl(), and micropolisj.engine.ShipSprite.moveImpl().
|
protected |
Definition at line 60 of file Sprite.java.
References micropolisj.engine.Micropolis.getTile(), and micropolisj.engine.Micropolis.testBounds().
Referenced by micropolisj.engine.TrainSprite.moveImpl(), and micropolisj.engine.MonsterSprite.moveImpl().
final boolean micropolisj.engine.Sprite.isVisible | ( | ) |
Tells whether this sprite is visible.
Definition at line 99 of file Sprite.java.
References micropolisj.engine.Sprite.frame.
final void micropolisj.engine.Sprite.move | ( | ) |
Perform this agent's movement and animation.
Definition at line 89 of file Sprite.java.
References micropolisj.engine.Sprite.lastX, micropolisj.engine.Sprite.lastY, micropolisj.engine.Sprite.moveImpl(), micropolisj.engine.Sprite.x, and micropolisj.engine.Sprite.y.
|
protectedpure 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.
Implemented in micropolisj.engine.RocketSprite, micropolisj.engine.MonsterSprite, micropolisj.engine.SpaceshipSprite, micropolisj.engine.ShipSprite, micropolisj.engine.TrainSprite, micropolisj.engine.AirplaneSprite, micropolisj.engine.HelicopterSprite, micropolisj.engine.ExplosionSprite, and micropolisj.engine.TornadoSprite.
Referenced by micropolisj.engine.Sprite.move().
|
protected |
Definition at line 75 of file Sprite.java.
void micropolisj.engine.Sprite.remove | ( | ) |
Definition at line 191 of file Sprite.java.
References micropolisj.engine.Micropolis.sprites.
void micropolisj.engine.Sprite.setMicropolis | ( | Micropolis | micro | ) |
Definition at line 56 of file Sprite.java.
|
protected |
Definition at line 71 of file Sprite.java.
Referenced by micropolisj.engine.RocketSprite.setDestination(), and micropolisj.engine.RocketSprite.setStart().
int micropolisj.engine.Sprite.frame |
Definition at line 42 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.RocketSprite.explodeSprite(), micropolisj.engine.Sprite.explodeSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.Sprite.isVisible(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.TornadoSprite.moveImpl(), micropolisj.engine.ExplosionSprite.moveImpl(), micropolisj.engine.HelicopterSprite.moveImpl(), micropolisj.engine.AirplaneSprite.moveImpl(), micropolisj.engine.TrainSprite.moveImpl(), micropolisj.engine.ShipSprite.moveImpl(), micropolisj.engine.MonsterSprite.moveImpl(), micropolisj.engine.RocketSprite.moveImpl(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), and micropolisj.engine.TornadoSprite.TornadoSprite().
int micropolisj.engine.Sprite.height = 32 |
Definition at line 40 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), and micropolisj.engine.TornadoSprite.TornadoSprite().
SpriteKind micropolisj.engine.Sprite.kind |
Definition at line 35 of file Sprite.java.
Referenced by micropolisj.engine.Sprite.explodeSprite(), and micropolisj.engine.Sprite.Sprite().
int micropolisj.engine.Sprite.lastX |
Definition at line 46 of file Sprite.java.
Referenced by micropolisj.engine.Sprite.move().
int micropolisj.engine.Sprite.lastY |
Definition at line 47 of file Sprite.java.
Referenced by micropolisj.engine.Sprite.move().
int micropolisj.engine.Sprite.offx |
Definition at line 37 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), micropolisj.engine.TornadoSprite.TornadoSprite(), and micropolisj.engine.TrainSprite.TrainSprite().
int micropolisj.engine.Sprite.offy |
Definition at line 38 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), micropolisj.engine.TornadoSprite.TornadoSprite(), and micropolisj.engine.TrainSprite.TrainSprite().
int micropolisj.engine.Sprite.width = 32 |
Definition at line 39 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), and micropolisj.engine.TornadoSprite.TornadoSprite().
int micropolisj.engine.Sprite.x |
Definition at line 43 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.RocketSprite.explodeSprite(), micropolisj.engine.Sprite.explodeSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.Sprite.move(), micropolisj.engine.TornadoSprite.moveImpl(), micropolisj.engine.ExplosionSprite.moveImpl(), micropolisj.engine.HelicopterSprite.moveImpl(), micropolisj.engine.AirplaneSprite.moveImpl(), micropolisj.engine.TrainSprite.moveImpl(), micropolisj.engine.ShipSprite.moveImpl(), micropolisj.engine.SpaceshipSprite.moveImpl(), micropolisj.engine.MonsterSprite.moveImpl(), micropolisj.engine.RocketSprite.moveImpl(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), micropolisj.engine.RocketSprite.stepsTilBoom(), micropolisj.engine.TornadoSprite.TornadoSprite(), and micropolisj.engine.TrainSprite.TrainSprite().
int micropolisj.engine.Sprite.y |
Definition at line 44 of file Sprite.java.
Referenced by micropolisj.engine.AirplaneSprite.AirplaneSprite(), micropolisj.engine.RocketSprite.explodeSprite(), micropolisj.engine.Sprite.explodeSprite(), micropolisj.engine.ExplosionSprite.ExplosionSprite(), micropolisj.engine.HelicopterSprite.HelicopterSprite(), micropolisj.engine.MonsterSprite.MonsterSprite(), micropolisj.engine.Sprite.move(), micropolisj.engine.TornadoSprite.moveImpl(), micropolisj.engine.ExplosionSprite.moveImpl(), micropolisj.engine.HelicopterSprite.moveImpl(), micropolisj.engine.AirplaneSprite.moveImpl(), micropolisj.engine.TrainSprite.moveImpl(), micropolisj.engine.ShipSprite.moveImpl(), micropolisj.engine.SpaceshipSprite.moveImpl(), micropolisj.engine.MonsterSprite.moveImpl(), micropolisj.engine.RocketSprite.moveImpl(), micropolisj.engine.RocketSprite.RocketSprite(), micropolisj.engine.ShipSprite.ShipSprite(), micropolisj.engine.SpaceshipSprite.SpaceshipSprite(), micropolisj.engine.RocketSprite.stepsTilBoom(), micropolisj.engine.TornadoSprite.TornadoSprite(), and micropolisj.engine.TrainSprite.TrainSprite().