|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectActor
QuantumObject
Spaceship
ManuallyControlledSpaceship
public class ManuallyControlledSpaceship
A spaceship controlled by the player -- white or black.
| Nested Class Summary | |
|---|---|
protected class |
ManuallyControlledSpaceship.Keys
|
| Field Summary | |
|---|---|
protected boolean |
autofire
If the spaceship should automatically fire whenever possible. |
static int |
BASE_HP
|
static int |
COLLISION
How many hitpoints a collision with another spaceship should cost. |
protected ManuallyControlledSpaceship.Keys |
keys
Contains strings with the keys for all possible actions. |
protected boolean |
mayMoveUpAndDown
Should the player be allowed to move the spaceship up and down? |
static int |
MOVEMENT
How many pixels the spaceship should move per turn when a movement key is pressed. |
| Fields inherited from class Spaceship |
|---|
angled_guns, blink, blink_file, GUN_ANGLE, GUN_DISTANCE, guns, hitpoints, level, max_blink, max_hitpoints, n_guns, N_GUNS, side |
| Fields inherited from class QuantumObject |
|---|
destroysOnNextTurn, disappear, mantissa, speed |
| Constructor Summary | |
|---|---|
ManuallyControlledSpaceship(int the_level)
|
|
| Method Summary | |
|---|---|
void |
act()
Do quantum object duties, then check what the player wants the spaceship to do. |
void |
addHitpoints(int n_hitpoints)
|
void |
beforeDestruction()
Before destruction: tell world to announce the winner (which is the other side, if this is destroyed). |
boolean |
getMayMoveUpAndDown()
|
int |
getSide()
|
boolean |
hit(AIControlledSpaceship s)
hit. |
void |
moveDown()
|
void |
moveLeft()
|
void |
moveRight()
|
void |
moveUp()
|
void |
removeHitpoints(int n_hitpoints)
|
void |
setHitpoints(int n_hitpoints)
|
void |
setMayMoveUpAndDown(boolean may)
|
void |
setSide(int the_side)
|
protected void |
setupImages()
Sort-of abstract method available for overriddance [sic]. |
protected void |
setupKeys()
Set keys according to the side we're on. |
void |
updateHealth()
Update the health bar in InvadersWorld. |
| Methods inherited from class Spaceship |
|---|
addGun, angle, doBlink, fire, getBlinkFile, getHitpoints, getLevel, getMaxBlink, getMaxHitpoints, getNumberOfGuns, hit, removeGun, reorderGuns, setAngledGuns, setBlinkFile, setLevel, setMaxBlink, setMaxHitpoints |
| Methods inherited from class QuantumObject |
|---|
getDestroysOnNextTurn, getSpeed, move, setDestroysOnNextTurn, setSpeed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BASE_HP
public static final int COLLISION
public static final int MOVEMENT
protected boolean autofire
protected boolean mayMoveUpAndDown
protected ManuallyControlledSpaceship.Keys keys
ManuallyControlledSpaceship.Keys,
act()| Constructor Detail |
|---|
public ManuallyControlledSpaceship(int the_level)
| Method Detail |
|---|
protected void setupImages()
Spaceship
setupImages in class SpaceshipSpaceship.doBlink()protected void setupKeys()
public void setSide(int the_side)
setSide in class Spaceshippublic int getSide()
getSide in class Spaceshippublic void setMayMoveUpAndDown(boolean may)
public boolean getMayMoveUpAndDown()
public void act()
act in class Spaceshippublic void moveLeft()
public void moveRight()
public void moveUp()
public void moveDown()
public void updateHealth()
InvadersWorld.setHealthBar(int side, int value)public void addHitpoints(int n_hitpoints)
addHitpoints in class Spaceshippublic void removeHitpoints(int n_hitpoints)
removeHitpoints in class Spaceshippublic void setHitpoints(int n_hitpoints)
setHitpoints in class Spaceshippublic void beforeDestruction()
beforeDestruction in class Spaceshippublic boolean hit(AIControlledSpaceship s)
QuantumObject
hit in class QuantumObjects - The object we are interacting with
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||