Invisible ceiling guide - UQdeco2800/2021-ext-studio-2 GitHub Wiki
Overview
The function is implemented to prevent the player jump out of the map.
Code implementation
Spawn invisible ceiling
Under the com/deco2800/game/areas/ForestGameArea
file, we generated the invisible ceiling on top of the screen :
public void spawnInvisibleCeiling(Vector2 worldBounds, GridPoint2 tileBounds) {
spawnEntityAt(
ObstacleFactory.createWall(worldBounds.x, WALL_WIDTH, PhysicsLayer.CEILING),
new GridPoint2(0, tileBounds.y + 8),
false,
false);
}