Benji Eudeline#29
Open
benjieud wants to merge 19 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To add new rooms I just modified the YAML file for the rooms. To add additional endings I added checks in the GameState for things like player health and whether the player had found the trophy. To enable a key to unlock a door I made a hash map to keep track of each door's lock state and a check to make sure the door is unlocked before letting the user in. A function in the key subclass changes the door to unlocked. To load each item into the correct subclass, I first used a switch case in LoadYAML to determine the correct type. Once the type is found, the correct information is put into the new item from the YAML. I used the GameState class to keep track of all of the item's actions. When used was set to true on an item, the action is called. To finish implementing the item subclasses and and add a new one I made actions that modified things in the GameState like the player health and the current room. For the tests I added a test to make sure an item is correctly added, and I tried to add a test to check if a player would die when expected to.
I started implementing a player and enemy health system, along with a way for the player to die, but I was not able to finish adding enemies into the game.
I fixed a small bug in Game that allowed items to be picked up again, when already in the player's inventory, by adding a check to see if the item is there still.