Bryce Clark#9
Open
Bryce285 wants to merge 20 commits into
Open
Conversation
Bryce285
commented
Dec 11, 2024
- Adding new rooms: To implement this feature, I added a kitchen, a treasure room, and three dungeon rooms in rooms.yaml. I also had to edit Game.java and GameState.java to allow the player to move to these new rooms.
- Adding a new ending: I chose to add an ending to the treasure room. To do this I had to edit GameState.java so that the game is marked as finished when the player gets there.
- Adding a locked door/key: I made it so that the player needs a key to open the door to the treasure room. To do this I added a key item to items.yaml, and then I had to edit Game.java so that the player has to use the key to open the treasure room door.
- Finish implementing subclasses: To do this I created the new Key, Food, and Armor subclasses in Key.java, Food.java, and Armor.java. I also added actions to all the items in items.yaml (the slime item doesn't have an action that modifies the gamestate since it is meant to function as more of an enemy than as a regular item). I then edited LoadYAML.java so that it reads in all the different items as the correct subclass. I couldn't get the Animals subclass to work though, possibly because having the poison frog as two different types is messing up the logic.
- Add a new subclass: The Food subclass is new, and contains the berries, beef, and bread items. To implement this I added the new items to items.yaml and then created Food.java, which extends Item.java. I also added to Game.java to allow the player to interact with these new items.
- Implement new tests: The two new tests that I added are testItemSubclasses, and testRoomContents. testItemSubclasses creates a new bread item and then checks that it is of type Food. testRoomContents loads the kitchen room and then verifies that it has the correct items in it.
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
accidently uploaded to the wrong place
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.