-
Notifications
You must be signed in to change notification settings - Fork 7
Terrain Movement Modifiers
HunterWhitty edited this page Sep 11, 2023
·
16 revisions
The TerrainTile
class contains a private float speedModifier variable which is used to represent a speed modifier to be applied to entities traversing on top of the tile. It is to act as a simple multiplier which should be used to scale the velocity vector of entities. The speedModifier attribute is accessed through the GameMap
class using the getTile method to return a TerrainTile and the getSpeedModifier method to get the speed modifier.
The TerrainTile
class also contains a private boolean isTraversable value which is used to determine if a tile is traversable or not. Non-traversable tiles are enforced via the spawning of 'invisible' entities which have collision boxes to prevent players from moving onto the tiles.