Brick class
Model Representation of a Brick. This is used to build obstacles for the player. Upon hitting the Brick, the score will be decreased.
- Inheritance
- Object
- Entity
- Brick
Constructors
Properties
- value ↔ int
-
The value is displayed and used to decrease the score
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
-
hitBy(
Entity e) → void -
Called when Entity e collides with this Entity
override
-
toString(
) → String -
Returns a string representing of this Brick
override
-
getDx(
) → double -
Gets the vertical movement for next update
inherited
-
getDy(
) → 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
-
update(
) → void -
Updates the Entity coordinates with it´s dy and dx values
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Static Methods
-
getStandardHeight(
) → double - Returns the percentage of the view height which one Brick will take up
-
getStandardWidth(
) → double - Returns the percentage of the view width which one Brick will take up