Dozer class

The model representation of the Dozer, the game's main character. It extends the class Entity.

Inheritance

Constructors

Dozer(Level level)
Creates a Dozer object with the zero id, the given score and other member variables. The zero id is used to recognize the dozer entity.

Properties

doubleUpActive ↔ bool
read / write
doubleUpFutures ↔ List<Future>
read / write
drillActive ↔ bool
read / write
drillFutures ↔ List<Future>
Fields that track if a power up is active
read / write
score ↔ int
The current score and length respectively of the Dozer
read / write
tailEntities ↔ List<DozerTail>
A list of all DozerTail Entities
read / write
dx ↔ double
The horizontal movement the Entity wants to make in the next update.
read / write, inherited
dy ↔ double
The vertical movement the Entity wants to make in the next update.
read / write, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
height ↔ int
The height of an Entity in percent of the view height
read / write, inherited
id ↔ int
The distinct id of an entity
read / write, inherited
level Level
Reference of the Level the entity is used in
read / write, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
width ↔ int
The width of an Entity in percent of the view width
read / write, inherited
x ↔ double
The horizontal coordinate of the Entity
read / write, inherited
y ↔ double
The vertical coordinate of the Entity
read / write, inherited

Methods

changeScore(int change) → void
Changes the score of the Dozer. Depending on the power up´s behaviour it will be different.
getDy() → double
Gets the vertical movement for next update
override
hitBy(Entity e) → void
Called when Entity e collides with this Entity
override
toString() → String
Returns a string representation of the Dozer
override
update() → void
Updates the Dozer movement, the DozerTail and his parent Entity
override
getDx() → double
Gets the vertical movement for next update
inherited
move(double dx, double dy) → void
Updates the Entity's moving parameters, e.g. dx and dy
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Constants

MAXIMUM_DOZER_HEIGHT → const double
The maximum possible height of the Dozer in percent of the viewport height
0.7
TAIL_GAP → const double
The gap between one DozerTail Entity and another in percent of one's height
0.5