CyberLord09 / CSSE1_Final

MIT License
0 stars 0 forks source link

Sprint #3 Pair #1 (Anvay + Yash) #10

Open illuminati1618 opened 1 month ago

illuminati1618 commented 1 month ago

Yash + Anvay Pair Issue

Our goal with this last sprint was to repair various aspects of the game before Night at the Museum, and also add a few small features.

There were also a major amount of merge conflicts, which added to the difficulty of making new developments while also making sure that nothing in the game broke meanwhile.

Cleaning up our levels

The first change we made was removing unused assets from our GameSetter files (ancient greece and ancient greece mini).

The hardest part about this was testing over and over again to make sure that no crucial assets were removed which caused other features to break. This happened with our lava, and took lots of testing to fix.

Fixing the assets

As a result of all the GameSetup changes, the enemies section in assets somehow became embedded in player. We noticed this, and fixed it so that the enemies could actually function.

There were also some duplicate assets. For example, there were two lava enemies, and also an extra Cerberus enemy.

Adding floors

We noticed that the ancient greece mini level did not have a floor. Because we want there to be no missing aspects of the game before N@TM, we decided to add a magma floor in the mini level to make it look more finished.

Fixing difficulty-related issues

In GameSet.js, there was a minor issue with the default difficulty. Because of this, we repaired it as shown below, then added difficulty modes back to our enemies, so that they would work differently per difficulty.

ORIGINAL:

this.difficulty = localStorage.getItem("difficulty") || "easy";

MODIFIED:

this.difficulty = localStorage.getItem("difficulty") || "normal";

Transitions

The last major change we did was refactoring transitions to use level tag rather level number. This is so that if any levels get reordered around, they would look nicer with their specifically-matched transition.

const index = GameEnv.levels.findIndex(level => level.tag === "Greece")  
GameControl.transitionToLevel(GameEnv.levels[index]);

The way this code works is by creates a constant names index, which finds the index of the level with the tag named "Greece." It then transitions to index, which in this case, is "Greece." We implemented this for all levels.