Top Description Fields Constructors Methods
org.lwjgl.examples.spaceinvaders

public Class AlienEntity

extends Entity
Class Inheritance

An entity which represents one of our space invader aliens.
Authors
Kevin Glass, Brian Matzon

Field Summary

Modifier and TypeField and Description
private static final int
BOTTOM_BORDER

Border at which player dies

private static final int
DOWNWARD_MOVEMENT

Movement made downwards when a border is hit

private long
frameDuration

The frame duration in milliseconds, i.e. how long any given frame of animation lasts

private int
frameNumber

The current frame of animation being displayed

private Sprite[]
frames

The animation frames

private Game
game

The game in which the entity exists

private long
lastFrameChange

The time since the last frame change took place

private static final int
LEFT_BORDER

Left border at which to shift direction

private float
moveSpeed

The speed at which the alient moves horizontally

private static final int
RIGHT_BORDER

Right border at which to shift direction

Inherited from org.lwjgl.examples.spaceinvaders.Entity:
dxdyspritexy

Constructor Summary

AccessConstructor and Description
public
AlienEntity(Game
The game in which this entity is being created
game
,
int
The intial x location of this alien
x
,
int
The intial y location of this alient
y
)

Create a new alien entity

Method Summary

Modifier and TypeMethod and Description
public void
collidedWith(Entity
The other entity
other
)

Implements abstract org.lwjgl.examples.spaceinvaders.Entity.collidedWith.

Notification that this alien has collided with another entity
public void
doLogic()

Overrides org.lwjgl.examples.spaceinvaders.Entity.doLogic.

Update the game logic related to aliens
public void
move(long
The time that has elapsed since last move
delta
)

Overrides org.lwjgl.examples.spaceinvaders.Entity.move.

Request that this alien moved based on time elapsed
Inherited from org.lwjgl.examples.spaceinvaders.Entity:
collidesWithdrawgetHorizontalMovementgetVerticalMovementgetXgetYsetHorizontalMovementsetVerticalMovement

Field Detail

BOTTOM_BORDERback to summary
private static final int BOTTOM_BORDER

Border at which player dies

DOWNWARD_MOVEMENTback to summary
private static final int DOWNWARD_MOVEMENT

Movement made downwards when a border is hit

frameDurationback to summary
private long frameDuration

The frame duration in milliseconds, i.e. how long any given frame of animation lasts

frameNumberback to summary
private int frameNumber

The current frame of animation being displayed

framesback to summary
private Sprite[] frames

The animation frames

gameback to summary
private Game game

The game in which the entity exists

lastFrameChangeback to summary
private long lastFrameChange

The time since the last frame change took place

LEFT_BORDERback to summary
private static final int LEFT_BORDER

Left border at which to shift direction

moveSpeedback to summary
private float moveSpeed

The speed at which the alient moves horizontally

RIGHT_BORDERback to summary
private static final int RIGHT_BORDER

Right border at which to shift direction

Constructor Detail

AlienEntityback to summary
public AlienEntity(Game game, int x, int y)

Create a new alien entity

Parameters
game:Game

The game in which this entity is being created

x:int

The intial x location of this alien

y:int

The intial y location of this alient

Method Detail

collidedWithback to summary
public void collidedWith(Entity other)

Implements abstract org.lwjgl.examples.spaceinvaders.Entity.collidedWith.

Notification that this alien has collided with another entity

Parameters
other:Entity

The other entity

doLogicback to summary
public void doLogic()

Overrides org.lwjgl.examples.spaceinvaders.Entity.doLogic.

Update the game logic related to aliens

moveback to summary
public void move(long delta)

Overrides org.lwjgl.examples.spaceinvaders.Entity.move.

Request that this alien moved based on time elapsed

Parameters
delta:long

The time that has elapsed since last move