-
Notifications
You must be signed in to change notification settings - Fork 1
Map Design
The map was created tile by tile using the following website https://www.piskelapp.com/. This allows the generation of .png files to create a custom map that suits the different kingdoms.
The image below shows the 3 sections/themes of the Map (Land Kingdom first, Ocean Kingdom, then Air Kingdom). This image is also used for the Map Tab Feature.
For more information on the tiles used in the game, see https://github.com/UQcsse3200/2024-studio-2/wiki/Map-Tiles
Several non-interactive items are strategically placed on the map to enhance the aesthetic appeal and create obstacles that players cannot traverse due to a Collider Function. This design choice adds complexity to player navigation, increasing the overall difficulty of the game.
Similar to the Map Tiles, these are also created on Piskel
- Add image to textures.json file
- Specify number of spawns in entitySpawn.json file and initialise in EntitySpawnConfig.java
public int NUM_SEAWEED;
- Create Function to create Entity, adjust Collider function if needed.
public static Entity createSeaweed() {
Entity seaweed =
new Entity()
.addComponent(new TextureRenderComponent("images/seaweed.png"))
.addComponent(new PhysicsComponent())
.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));
seaweed.getComponent(PhysicsComponent.class).setBodyType(BodyType.StaticBody);
seaweed.getComponent(TextureRenderComponent.class).scaleEntity();
seaweed.scaleHeight(2.5f);
PhysicsUtils.setScaledCollider(seaweed, 0.5f, 0.2f);
return seaweed;
}
- Create the function to Spawn the Entity in ForestGameArea.java and add function to create()
public void create() {
spawnSeaweed(2); // Specify zone in parameter: 1 - Land, 2 - Water, 3 - Air
}
private void spawnSeaweed(int zone) {
GridPoint2 minPos = new GridPoint2(0, AREA_SIZE.y * 16 * (zone - 1));
GridPoint2 maxPos = new GridPoint2(AREA_SIZE.x * 16, AREA_SIZE.y * 16 * zone);
for (int i = 0; i < ForestSpawnConfig.NUM_SEAWEED; i++) {
GridPoint2 randomPos = RandomUtils.random(minPos, maxPos);
Entity seaweed = ObstacleFactory.createSeaweed(); // Calling on the function created in step 3.
spawnEntityAt(seaweed, randomPos, true, false);
}
}
As seen in the sketch, the Map is composed of three sections with entities, minigames, and the games features spawned at specific areas. Initially, each section is separated by a door/gate but the final game, Kingdom's are separated by 'fog' which will disappear after the Final Boss is defeated.
In the image below, the UML diagram for the feature/map branch shows all the classes that the team members of the map team modified. The UML diagram also shows the new functions that were added in their respective classes.
@Test
void testSeaweedCreation() {
assertNotNull(seaweed, "Seaweed should not be null");
}
@Test
void testSeaweedEntityType() {
assert(seaweed.getClass() == Entity.class);
}
@Test
void testStarfishCreation() {
assertNotNull(starfish, "Starfish should not be null");
}
@Test
void testStarfishEntityType() {
assert(starfish.getClass() == Entity.class);
}
@Test
void testCloudCreation() {
assertNotNull(cloud, "Cloud should not be null");
}
@Test
void testCloudEntityType() {
assert(cloud.getClass() == Entity.class);
}
@Test
void testTreeCreation() {
assertNotNull(tree, "Tree should not be null");
}
@Test
void testTreeEntityType() {
assert(tree.getClass() == Entity.class);
}