Level class

The model representation of a Level

Constructors

Level(int initialTimeLimit, int initialScore, int targetScore, double laneSpeed, int level, int viewHeight, int viewWidth)
Creates a new Level

Properties

initialScore → int
The initial score of this level
final
initialTimeLimit → int
The initial time limit of this level
final
laneSpeed ↔ double
The lanespeed equals the percentage which Entity's (such as Brick, Dot) move per second
read / write
level → int
The number of this level
final
remainingEntities ↔ List<Entity>
The List which contains all remaining Entity's ordered ascending to the displayed time
read / write
slowDownActive ↔ bool
read / write
slowDownFutures ↔ List<Future>
Fields to keep track of power up´s
read / write
targetScore → int
The target score a user has to reach to win this level
final
timeLimit ↔ double
The remaining time to accomplish this level in ms
read / write
tries ↔ int
The number of tries a user already tried this level
read / write
viewHeight → int
The view height in pixel
final
viewWidth → int
The view width in pixel
final
visibleEntities ↔ Map<int, Entity>
The map which contains all the Entity's which are visible within the screen. Key is the entity's id and value is the entity's object reference.
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

addNewlyVisibleEntities() → void
Adds all Entity's that became visible since the last update.
changeLaneSpeed(int change) → void
Changes the lane speed of the level. Provide a positive change to increase the lane speed, a negative change to decrease the lane speed.
changeTimeLimit(double change) → void
Changes the time limit of the level. The provided change is in seconds. Provide a positive change to increase the time limit, a negative change to decrease the time limit.
checkCollisions() → void
Checks collision of all visible Entity's with the Dozer.
gameLost() → bool
Returns true if the game is lost, false otherwise
gameWon() → bool
Returns true if the game is won, false otherwise
getDozer() Dozer
Returns the Dozer object reference
getLevel() → int
Return the current level
getRemainingYFromTime(int ms) → double
Returns the vertical y value according to the time when the Entity would appear on the view
getScore() → int
Returns the current score, which is ofc scientifically proved ;)
getVerticalMovementPerUpdate() → double
Returns the vertical distance a scrolling Entity (like a Brick or Dot) moves per frame update
getVisibleEntities() → Map<int, Entity>
Returns a new map of all currently visible Entity's. The key value pair of a map entry is:
removeInvisibleEntities() → void
Removes invisible Entity's mainly entities that scrolled past the viewport from the visibileEntities Map.
update() → void
Updates all visible, newly visible and not-visible-anymore Entity's. Also checks for collisions.
updateDozerTailInVisibleEntities() → void
Adds or removes DozerTail - Entity's depending on the current score
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

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