Skip to content

Benji Eudeline#29

Open
benjieud wants to merge 19 commits into
AQNclasses:mainfrom
benjieud:main
Open

Benji Eudeline#29
benjieud wants to merge 19 commits into
AQNclasses:mainfrom
benjieud:main

Conversation

@benjieud
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants