Entity class

The model representation of all the game entities displayed on the screen when the user plays the game.

Implementers

Constructors

Entity()

Properties

dx ↔ double
The horizontal movement the Entity wants to make in the next update.
read / write
dy ↔ double
The vertical movement the Entity wants to make in the next update.
read / write
height ↔ int
The height of an Entity in percent of the view height
read / write
id ↔ int
The distinct id of an entity
read / write
level Level
Reference of the Level the entity is used in
read / write
width ↔ int
The width of an Entity in percent of the view width
read / write
x ↔ double
The horizontal coordinate of the Entity
read / write
y ↔ double
The vertical coordinate of the Entity
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getDx() → double
Gets the vertical movement for next update
getDy() → double
Gets the vertical movement for next update
hitBy(Entity e) → void
Called when Entity e collides with this Entity
move(double dx, double dy) → void
Updates the Entity's moving parameters, e.g. dx and dy
toString() → String
The String representation of an Entity which is just the name of the class.
override
update() → void
Updates the Entity coordinates with it´s dy and dx values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

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