TileMapLevel<T extends Tile> class

A level which holds a tileMap.

To change the player's position on the map, use the coordinates setter.

Inheritance

Constructors

TileMapLevel({required Game game, required TileMap tileMap, required T makeTile(Point<int> point, int flags), Point<double> initialCoordinates = const Point(0.0, 0.0), double initialHeading = 0.0, List<Ambiance>? ambiances, Map<String, Command>? commands, AssetReference? music, List<RandomSound>? randomSounds})
Create an instance.

Properties

ambiancePlaybacks Map<Ambiance, SoundPlayback>
The playback settings for the list of ambiances.
finalinherited
ambiances List<Ambiance>
A list of ambiances for this level.
finalinherited
commandNextRuns List<NextRun<Command>>
The times before commands should run next.
finalinherited
commands Map<String, Command>
The commands this level recognises.
finalinherited
coordinates Point<double>
The player's coordinates.
getter/setter pair
game Game
The game this level is part of.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
heading double
The player's bearing in degrees.
getter/setter pair
initialCoordinates Point<double>
The initial coordinates of the player.
final
initialHeading double
The initial heading of the player.
final
makeTile → T Function(Point<int> point, int flags)
The function to convert flags to a tile.
final
music AssetReference?
The music for this level.
finalinherited
musicSound Sound?
The playing music.
getter/setter pairinherited
random Random
The game's random sound generator.
no setterinherited
randomSoundNextPlays List<NextRun<RandomSound>>
The times that randomSounds should play next.
finalinherited
randomSoundPlaybacks Map<RandomSound, SoundPlayback>
The playback settings for the list of randomSounds.
finalinherited
randomSounds List<RandomSound>
All the random sounds on this level.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stoppedCommands List<NextRun<Command>>
The old command next runs.
finalinherited
tileMap TileMap
The tile map to use.
final

Methods

getCommandNextRun(Command command) NextRun<Command>?
Get the next run value for the given command.
inherited
getRandomSoundNextPlay(RandomSound randomSound) NextRun<RandomSound>
Get the next run for the given randomSound.
inherited
getTile(Point<int> point) → T
Get the tile at the given point.
handleSdlEvent(Event event) → void
Handle an SDL event.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCover(Level other) → void
What should happen when this level is covered by another level.
inherited
onPop(double? fadeLength) → void
What should happen when this level is popped from a level stack.
inherited
onPush({double? fadeLength}) → void
What should happen when this level is pushed into a level stack.
inherited
onReveal(Level old) → void
What should happen when this level is revealed by another level being popped from on top of it.
inherited
registerCommand(String name, Command command) → void
Register a command on this level.
inherited
runCommand(Command command) → void
Run the given command.
inherited
scheduleRandomSound(RandomSound sound) → void
Schedule a random sound to play.
inherited
startCommand(String name) bool
Start the command with the given name.
inherited
stopCommand(String name) bool
Stop the command with the given name.
inherited
stopCommands(int timeDelta) → void
Remove any commands from the stoppedCommands list that can now be ran again.
inherited
stopPlayback(SoundPlayback playback) → void
Stop playback.
inherited
tick(int timeDelta) → void
Let this level tick.
inherited
tickCommands(int timeDelta) → void
Tick all commandNextRuns.
inherited
tickRandomSounds(int timeDelta) → void
Tick all random sounds.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited