City path and Flood generation fix - UQdeco2800/2022-studio-3 GitHub Wiki

Issue

There was a game play bug after Sprint 3 in which the flooding events were overriding the city path tiles, so they would appear momentarily at the beginning of the game and quickly disappear. It was discovered this was because the map terrain is built before BuildingGenerator and thus PathGenerator, and the flooding functionality worked by returning a new terrain component each time the flooding event was run.

Fix

This was fixed by modifying AtlantisGameArea to run the BuildingGenerator and PathGenerator during initialisation.

image

The flood() method could then be modified so as to replace the city paths according to what it had built during initialisation, by calling spawnPaths(...)

image