Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
K
L
M
N
P
Q
R
S
T
U
V
W
X
Y
A
abs_speed
- Variable in class
Gun
Absolute value of the speed vector that's set to missiles.
act()
- Method in class
AIControlledSpaceship
act()
- Method in class
AngledGuns
act()
- Method in class
BulletBill
act()
- Method in class
Collectible
act()
- Method in class
Enemy1
act()
- Method in class
Enemy2
act()
- Method in class
Enemy3
act()
- Method in class
FasterGuns
act()
- Method in class
Health
act()
- Method in class
InvadersWorld
Actions that a world just has to perform.
act()
- Method in class
Laser
act()
- Method in class
ManuallyControlledSpaceship
Do quantum object duties, then check what the player wants the spaceship to do.
act()
- Method in class
Missile
act()
- Method in class
MoreGuns
act()
- Method in class
QuantumObject
A day in the life of a quantum object: 1.
act()
- Method in class
Sickness
act()
- Method in class
Spaceship
act()
- Method in class
StraightGuns
act()
- Method in class
StrongerGuns
add(Vector)
- Method in class
Vector
Add a vector to this vector.
addGun(int, Gun)
- Method in class
Spaceship
Add a gun in the given position.
addHitpoints(int)
- Method in class
ManuallyControlledSpaceship
addHitpoints(int)
- Method in class
Spaceship
addObjectToDestroy(QuantumObject)
- Method in class
InvadersWorld
AIControlledSpaceship
- Class in
<Unnamed>
That would be a spaceship that's flying around on its own, and doesn't need a player to steer it.
AIControlledSpaceship(int)
- Constructor for class
AIControlledSpaceship
angle
- Variable in class
Gun
Angle the missiles are launched with (to y axis, value in radians).
angle(double, double)
- Method in class
Spaceship
Return an angle that lies between -max_angle and max_angle for x between 0 and 1
angled_guns
- Variable in class
Spaceship
Determines if guns should shoot in a straight way (angled_guns = false) or rather in a widespread way (angled_guns = true).
AngledGuns
- Class in
<Unnamed>
Make the ship's guns shoot in a more widespread way, i.
AngledGuns()
- Constructor for class
AngledGuns
autofire
- Variable in class
ManuallyControlledSpaceship
If the spaceship should automatically fire whenever possible.
B
BAR_HEIGHT
- Static variable in class
InvadersWorld
Health bars' height.
BAR_WIDTH
- Static variable in class
InvadersWorld
Health bars' width.
BASE_DAMAGE
- Static variable in class
BulletBill
BASE_DAMAGE
- Static variable in class
Laser
BASE_HP
- Static variable in class
Enemy1
BASE_HP
- Static variable in class
Enemy2
BASE_HP
- Static variable in class
ManuallyControlledSpaceship
BASE_RECOVERY
- Static variable in class
BulletBillGun
BASE_RECOVERY
- Static variable in class
LaserGun
BASE_SPEED
- Static variable in class
CollectibleFactory
BASE_SPEED
- Static variable in class
Enemy1
BASE_SPEED
- Static variable in class
Enemy2
beforeDestruction()
- Method in class
AIControlledSpaceship
beforeDestruction()
- Method in class
ManuallyControlledSpaceship
Before destruction: tell world to announce the winner (which is the other side, if this is destroyed).
beforeDestruction()
- Method in class
Spaceship
This method is called right before the spaceship is destroyed by (and only by) lack of hitpoints.
BLACK
- Static variable in class
InvadersWorld
blackBar
- Variable in class
InvadersWorld
blink
- Variable in class
Spaceship
Variable containing the state of the blink animation that happens when the spaceship is damaged.
blink_file
- Variable in class
Spaceship
Filename of the sprite to be used while blinking, i.
BulletBill
- Class in
<Unnamed>
Basically: Dummy class for testing if the bullets work.
BulletBill(int)
- Constructor for class
BulletBill
BulletBill()
- Constructor for class
BulletBill
BulletBillGun
- Class in
<Unnamed>
Shoots BulletBills.
BulletBillGun()
- Constructor for class
BulletBillGun
BulletBillGun(double, double)
- Constructor for class
BulletBillGun
BulletBillGun(Vector)
- Constructor for class
BulletBillGun
C
C_ANGLEDGUNS
- Static variable in class
CollectibleFactory
C_FASTERGUNS
- Static variable in class
CollectibleFactory
C_HEALTH
- Static variable in class
CollectibleFactory
C_MOREGUNS
- Static variable in class
CollectibleFactory
C_SICKNESS
- Static variable in class
CollectibleFactory
C_STRAIGHTGUNS
- Static variable in class
CollectibleFactory
C_STRONGERGUNS
- Static variable in class
CollectibleFactory
chance
- Variable in class
InvadersWorld
Array[N_SIDES]: Denominator for probability P for spaceship creation.
coll_chance
- Variable in class
InvadersWorld
Array[N_SIDES]: Denominator for probability P for collectible creation.
Collectible
- Class in
<Unnamed>
Collectible: Base class for collectible items such as power-ups, etc.
Collectible()
- Constructor for class
Collectible
collectible()
- Method in class
CollectibleFactory
Spits out a random collectible which has a speed based on the "side" variable.
CollectibleFactory
- Class in
<Unnamed>
Produces random collectibles.
CollectibleFactory(int)
- Constructor for class
CollectibleFactory
collFactory
- Variable in class
InvadersWorld
COLLISION
- Static variable in class
ManuallyControlledSpaceship
How many hitpoints a collision with another spaceship should cost.
color
- Variable in class
Label
copy_gun()
- Method in class
BulletBillGun
copy_gun()
- Method in class
Gun
Return an exact copy of this gun.
copy_gun()
- Method in class
LaserGun
createCollectible(int, int, int)
- Method in class
InvadersWorld
Uses the side's collectible factory to get a random collectible.
D
damage
- Variable in class
Missile
DEFAULT_COLOR
- Static variable in class
Label
DEFAULT_FONT
- Static variable in class
Label
destroyList
- Variable in class
InvadersWorld
List containing objects that need destruction at the start of the next turn.
destroysOnNextTurn
- Variable in class
QuantumObject
Can be set to us by any caller within a given game turn.
direction
- Variable in class
Gun
Direction the gun is facing.
direction
- Variable in class
SpaceshipFactory
Direction the created spaceships will fly in.
disappear
- Variable in class
QuantumObject
Whether the quantum object should fall off the world (i.
DISTANCE
- Static variable in class
InvadersWorld
Distance of health bars to game field edges.
doBlink()
- Method in class
Spaceship
Do the blinking animation.
down
- Variable in class
ManuallyControlledSpaceship.Keys
draw()
- Method in class
HealthBar
Set the health bar's sprite to the image that corresponds to the current quotient health/max_health.
dx
- Variable in class
Gun
X distance of launched bullets from spaceship center.
DY
- Static variable in class
BulletBillGun
dy
- Variable in class
Gun
DY
- Static variable in class
LaserGun
E
Enemy1
- Class in
<Unnamed>
A smaller, lighter, faster enemy.
Enemy1(int)
- Constructor for class
Enemy1
ENEMY1
- Static variable in class
SpaceshipFactory
Enemy2
- Class in
<Unnamed>
A slower, but more heavy enemy with more hitpoins.
Enemy2(int)
- Constructor for class
Enemy2
ENEMY2
- Static variable in class
SpaceshipFactory
Enemy3
- Class in
<Unnamed>
A quite big enemy.
Enemy3(int)
- Constructor for class
Enemy3
F
factory
- Variable in class
InvadersWorld
FasterGuns
- Class in
<Unnamed>
FasterGuns: Increase firing speed of guns, up to a maximum of 1 missile every 5 turns.
FasterGuns()
- Constructor for class
FasterGuns
fire()
- Method in class
Spaceship
Try to fire (all) the guns.
font
- Variable in class
Label
G
gameOver(int)
- Method in class
InvadersWorld
Called when the game is totally over, this method displays an end screen.
gameOverNextTurn(int)
- Method in class
InvadersWorld
get_dx()
- Method in class
Gun
get_dy()
- Method in class
Gun
get_missile()
- Method in class
BulletBillGun
get_missile()
- Method in class
Gun
get_missile()
- Method in class
LaserGun
getAbsSpeed()
- Method in class
Gun
getAngle()
- Method in class
Gun
getBlinkFile()
- Method in class
Spaceship
getColor()
- Method in class
Label
getDamage()
- Method in class
Missile
getDestroysOnNextTurn()
- Method in class
QuantumObject
getDeviation()
- Static method in class
AIControlledSpaceship
getDirection()
- Method in class
SpaceshipFactory
getFont()
- Method in class
Label
getHitpoints()
- Method in class
Spaceship
getInitialRecovery()
- Static method in class
Gun
getInitialSpeed()
- Static method in class
AIControlledSpaceship
getLevel()
- Method in class
Gun
getLevel()
- Method in class
Spaceship
getLevel()
- Method in class
SpaceshipFactory
getMaxBlink()
- Method in class
Spaceship
getMaxHitpoints()
- Method in class
Spaceship
getMayMoveUpAndDown()
- Method in class
ManuallyControlledSpaceship
getNumberOfGuns()
- Method in class
Spaceship
getRecovery()
- Method in class
Gun
getSide()
- Method in class
Gun
getSide()
- Method in class
ManuallyControlledSpaceship
getSide()
- Method in class
Missile
getSide()
- Method in class
Spaceship
getSpeed()
- Method in class
QuantumObject
getTimer()
- Method in class
Gun
getX()
- Method in class
Vector
getY()
- Method in class
Vector
Gun
- Class in
<Unnamed>
Gun: shoots (i.
Gun(double, double)
- Constructor for class
Gun
Gun(Vector)
- Constructor for class
Gun
Gun()
- Constructor for class
Gun
GUN_ANGLE
- Static variable in class
Spaceship
Determines the angular distance between guns when angled_guns is true.
GUN_DISTANCE
- Static variable in class
Spaceship
X distance between guns on one spaceship.
guns
- Variable in class
Spaceship
H
Health
- Class in
<Unnamed>
Add some (few) hitpoints to the ship.
Health()
- Constructor for class
Health
health
- Variable in class
HealthBar
Current health.
HealthBar
- Class in
<Unnamed>
Show (approximately) how much health the corresponding player has.
HealthBar()
- Constructor for class
HealthBar
HEIGHT
- Static variable in class
InvadersWorld
Game field height.
hit(ManuallyControlledSpaceship)
- Method in class
AIControlledSpaceship
hit(ManuallyControlledSpaceship)
- Method in class
AngledGuns
hit(ManuallyControlledSpaceship)
- Method in class
Collectible
Dummy hit method.
hit(ManuallyControlledSpaceship)
- Method in class
FasterGuns
Iterate through the ship's guns, speeding them up one by one.
hit(ManuallyControlledSpaceship)
- Method in class
Health
hit(AIControlledSpaceship)
- Method in class
ManuallyControlledSpaceship
hit(Spaceship)
- Method in class
Missile
Dummy hit function that allows for dummy missiles.
hit(ManuallyControlledSpaceship)
- Method in class
MoreGuns
hit(Actor)
- Method in class
QuantumObject
hit.
hit(ManuallyControlledSpaceship)
- Method in class
Sickness
hit(Missile)
- Method in class
Spaceship
If the missile was shot by an enemy, subtract hitpoints.
hit(ManuallyControlledSpaceship)
- Method in class
StraightGuns
hit(ManuallyControlledSpaceship)
- Method in class
StrongerGuns
hitpoints
- Variable in class
Spaceship
I
increaseLevel()
- Method in class
SpaceshipFactory
init()
- Method in class
BulletBillGun
init()
- Method in class
Gun
init()
- Method in class
LaserGun
initial_recovery
- Static variable in class
Gun
Initial recovery time of this kind of gun.
initial_speed
- Static variable in class
AIControlledSpaceship
The initial speed the spaceship gets assigned on creation.
InvadersWorld
- Class in
<Unnamed>
InvadersWorld: A styled and fun Space Invaders clone.
InvadersWorld()
- Constructor for class
InvadersWorld
InvadersWorld(int, int, int)
- Constructor for class
InvadersWorld
InvadersWorld constructor.
K
keys
- Variable in class
ManuallyControlledSpaceship
Contains strings with the keys for all possible actions.
L
Label
- Class in
<Unnamed>
Something that contains some text and can be shown in the world.
Label(String)
- Constructor for class
Label
Label(String, Color)
- Constructor for class
Label
Label(String, Font)
- Constructor for class
Label
Label(String, Color, Font)
- Constructor for class
Label
Laser
- Class in
<Unnamed>
Awesome laser beams.
Laser(int)
- Constructor for class
Laser
Creates a new laser beam, colored according to damage level.
Laser()
- Constructor for class
Laser
LaserGun
- Class in
<Unnamed>
Shoots laser beams.
LaserGun()
- Constructor for class
LaserGun
LaserGun(double, double)
- Constructor for class
LaserGun
LaserGun(Vector)
- Constructor for class
LaserGun
left
- Variable in class
ManuallyControlledSpaceship.Keys
length()
- Method in class
Vector
Absolute value of the vector, a.
level
- Variable in class
Gun
Level of the gun (and thus of the missiles).
level
- Variable in class
Spaceship
level
- Variable in class
SpaceshipFactory
Level the created spaceships will (approximately) have.
LEVEL_DEVIATION
- Static variable in class
SpaceshipFactory
Random deviation in the level of created spaceships.
M
mantissa
- Variable in class
QuantumObject
Contains the mantissa that remains from speed calculations (since Greenfoot only allows it to do pixel-based movements).
ManuallyControlledSpaceship
- Class in
<Unnamed>
A spaceship controlled by the player -- white or black.
ManuallyControlledSpaceship(int)
- Constructor for class
ManuallyControlledSpaceship
ManuallyControlledSpaceship.Keys
- Class in
<Unnamed>
ManuallyControlledSpaceship.Keys()
- Constructor for class
ManuallyControlledSpaceship.Keys
max_blink
- Variable in class
Spaceship
How many turns the blinking animations should last.
max_health
- Variable in class
HealthBar
max_hitpoints
- Variable in class
Spaceship
maybeCreateCollectible(int, int, int)
- Method in class
InvadersWorld
Usually called by dying spaceships, this rolls a dice and maybe creates a collectible at that very place.
mayMoveUpAndDown
- Variable in class
ManuallyControlledSpaceship
Should the player be allowed to move the spaceship up and down?
missile()
- Method in class
Gun
Emit a new bullet or null if not ready yet.
Missile
- Class in
<Unnamed>
Base class for projectiles and other kinds of things one can shoot on his enemies.
Missile()
- Constructor for class
Missile
MoreGuns
- Class in
<Unnamed>
Add one gun to a spaceship.
MoreGuns()
- Constructor for class
MoreGuns
move()
- Method in class
QuantumObject
move.
moveDown()
- Method in class
ManuallyControlledSpaceship
moveLeft()
- Method in class
ManuallyControlledSpaceship
MOVEMENT
- Static variable in class
ManuallyControlledSpaceship
How many pixels the spaceship should move per turn when a movement key is pressed.
moveRight()
- Method in class
ManuallyControlledSpaceship
moveUp()
- Method in class
ManuallyControlledSpaceship
MULTIPLAYER
- Static variable in class
InvadersWorld
Magic variable altering the game's behavior.
N
N_AI_CLASSES
- Static variable in class
SpaceshipFactory
N_COLLECTIBLE_CLASSES
- Static variable in class
CollectibleFactory
N_GUNS
- Static variable in class
Spaceship
n_guns
- Variable in class
Spaceship
N_SIDES
- Static variable in class
InvadersWorld
Number of sides participating in the game.
next_turn_winner
- Variable in class
InvadersWorld
if it is clear that one side wins or loses (within a Greenfoot turn), this variable is set to the side of the winner.
P
player
- Variable in class
InvadersWorld
Array[N_SIDES]: true if the corresponding side is a human player, false if they're AI.
player_generates_spaceships
- Variable in class
InvadersWorld
Array[N_SIDES]: true if the corresponding side should generate & send out autonomous spaceships.
POINTS
- Static variable in class
Health
POINTS
- Static variable in class
Sickness
Q
QuantumObject
- Class in
<Unnamed>
Anything that can move around in space and interact (fluctuate, collide, "hit") with other quantum objects.
QuantumObject()
- Constructor for class
QuantumObject
R
recovery
- Variable in class
Gun
The number to which timer is set after a bullet has been launched.
removeGun(int)
- Method in class
Spaceship
Remove the gun in the given position.
removeHitpoints(int)
- Method in class
ManuallyControlledSpaceship
removeHitpoints(int)
- Method in class
Spaceship
reorderGuns()
- Method in class
Spaceship
Set the guns' dx values so that the missiles are launched from appear in an neat, aligned fashion.
right
- Variable in class
ManuallyControlledSpaceship.Keys
S
set(double, double)
- Method in class
Vector
set_dx(int)
- Method in class
Gun
set_dy(int)
- Method in class
Gun
setAngledGuns(boolean)
- Method in class
Spaceship
Sets the ship to shoot straight or widespread (aka angled).
setBlinkFile(String)
- Method in class
Spaceship
setColor(Color)
- Method in class
Label
setDamage(int)
- Method in class
Missile
setDestroysOnNextTurn(boolean)
- Method in class
QuantumObject
setDeviation(double)
- Static method in class
AIControlledSpaceship
setDirection(double)
- Method in class
SpaceshipFactory
setFont(Font)
- Method in class
Label
setHealth(int)
- Method in class
HealthBar
setHealthBar(int, int)
- Method in class
InvadersWorld
setHealthBar(int, int, int)
- Method in class
InvadersWorld
setHitpoints(int)
- Method in class
ManuallyControlledSpaceship
setHitpoints(int)
- Method in class
Spaceship
setInitialRecovery(int)
- Static method in class
Gun
setInitialSpeed(double)
- Static method in class
AIControlledSpaceship
setLevel(int)
- Method in class
Gun
setLevel(int)
- Method in class
Spaceship
setLevel(int)
- Method in class
SpaceshipFactory
setMaxBlink(int)
- Method in class
Spaceship
setMaxHealth(int)
- Method in class
HealthBar
setMaxHitpoints(int)
- Method in class
Spaceship
setMayMoveUpAndDown(boolean)
- Method in class
ManuallyControlledSpaceship
setNumberOfGuns(ManuallyControlledSpaceship, int)
- Method in class
MoreGuns
Set the number of guns for a spaceship.
setRecovery(int)
- Method in class
Gun
setSide(int)
- Method in class
Enemy1
setSide(int)
- Method in class
Enemy2
setSide(int)
- Method in class
Enemy3
setSide(int)
- Method in class
Gun
setSide(int)
- Method in class
HealthBar
setSide(int)
- Method in class
ManuallyControlledSpaceship
setSide(int)
- Method in class
Missile
setSide(int)
- Method in class
Spaceship
setSpeed(Vector)
- Method in class
Gun
setSpeed(double, double)
- Method in class
Gun
setSpeed(Vector)
- Method in class
QuantumObject
setText(String)
- Method in class
Label
setTimer(int)
- Method in class
Gun
setupImages()
- Method in class
Enemy1
setupImages()
- Method in class
Enemy2
setupImages()
- Method in class
ManuallyControlledSpaceship
setupImages()
- Method in class
Spaceship
Sort-of abstract method available for overriddance [sic].
setupKeys()
- Method in class
ManuallyControlledSpaceship
Set keys according to the side we're on.
setX(double)
- Method in class
Vector
setY(double)
- Method in class
Vector
ship()
- Method in class
SpaceshipFactory
Return a random AIControlledSpaceship object that can be placed into the world.
shoot
- Variable in class
ManuallyControlledSpaceship.Keys
Sickness
- Class in
<Unnamed>
Subtract a rather large number of hit points from a spaceship.
Sickness()
- Constructor for class
Sickness
side
- Variable in class
CollectibleFactory
side
- Variable in class
Gun
Side the gun (and so the missiles) is on.
side
- Variable in class
HealthBar
side
- Variable in class
Missile
side
- Variable in class
Spaceship
side
- Variable in class
SpaceshipFactory
Side the created spaceships will be on.
Spaceship
- Class in
<Unnamed>
Stuff that flies through the sky.
Spaceship(int)
- Constructor for class
Spaceship
SpaceshipFactory
- Class in
<Unnamed>
Return random spaceships that can be allies (in 2-player mode) or enemies.
SpaceshipFactory(int, int)
- Constructor for class
SpaceshipFactory
speed
- Variable in class
Gun
Speed the missiles are set to when launched.
speed
- Variable in class
QuantumObject
speed_deviation
- Static variable in class
AIControlledSpaceship
The random deviation that is added to or removed from the inital speed on creation.
SPEED_DEVIATION
- Static variable in class
Enemy1
SPEED_DEVIATION
- Static variable in class
Enemy2
STARTING_ZONE
- Static variable in class
InvadersWorld
Size of the zone at the upper and lower edge of the playfield where new spaceships can be created.
StraightGuns
- Class in
<Unnamed>
Powerup to make the ship's guns shoot parallelly
StraightGuns()
- Constructor for class
StraightGuns
StrongerGuns
- Class in
<Unnamed>
Supply a ship with stronger guns (i.
StrongerGuns()
- Constructor for class
StrongerGuns
T
text
- Variable in class
Label
tick()
- Method in class
Gun
Send a tick to the gun every time act() is called in the containing spaceship.
timer
- Variable in class
Gun
This variable determines how many turns the gun has to wait before it may emit another bullet.
U
up
- Variable in class
ManuallyControlledSpaceship.Keys
updateHealth()
- Method in class
ManuallyControlledSpaceship
Update the health bar in InvadersWorld.
V
Vector
- Class in
<Unnamed>
A simple, two-dimensional vector.
Vector(double, double)
- Constructor for class
Vector
Vector(int, int)
- Constructor for class
Vector
Vector(Vector)
- Constructor for class
Vector
W
WHITE
- Static variable in class
InvadersWorld
whiteBar
- Variable in class
InvadersWorld
WIDTH
- Static variable in class
InvadersWorld
Game field width.
X
x
- Variable in class
Vector
Y
y
- Variable in class
Vector
A
B
C
D
E
F
G
H
I
K
L
M
N
P
Q
R
S
T
U
V
W
X
Y
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes