Skip to content

Development#1

Open
ciaranparker wants to merge 10 commits into
masterfrom
development
Open

Development#1
ciaranparker wants to merge 10 commits into
masterfrom
development

Conversation

@ciaranparker

Copy link
Copy Markdown
Owner

Object Oriented C# code for a game called dungeon explorer. After creating a player the user can pick up an item and battle an enemy.

… player in the games class as well as some user input for movement using if else statements. I also included the pick up item function in the player class to allow the user to pick up an item and add it to inventory as well as a function to view the inventory contents and the player information.
… the room. The item is then added to the players inventory and the contents of the inventory is then displayed. The user is also required to enter appropriate inputs for player movements, requesting an appropriate input be entered if an inappropriate input is entered. I have also added break at the end of the while playing loop to prevent the content in the loop to keep looping.
…emy attack each other, dealing random damage. Player which reached 0 or less health first dies and loses. Changed the health to public setter so that can be changed in the main game code. I also put the looting of the room code into a while loop so that I could break the loop when the user picks up an item, preventing the code from repeating unless the user does not enter a correct input.
@Mitchell-Nicholls

Copy link
Copy Markdown

What Went Well

  • Good use of error handling for when the user is choosing the path at which they take not allowing the user to proceed until a valid input is entered (could change this to an exception statement instead) and projecting the user's inventory to inform them of the item they pick up when it is proceeded through the Player.PickUpItem()
  • Intuitive structure of the code for all the files with it being easy to read and understand the flow which I appreciate as it is visually appealing in my opinion
  • Creative theme of different weapon items available to the user depending on the path it which they take with the inventory taking the different weapons into account when choosing them storing them in the player's inventory as they would intend
  • Getters and setters are effectively used for the player's name and health with the health being a get; set; for the value to change as evidenced by the enemy being damaged by the player and the name being a get; private set; for the value to not be changed once set

Improvements

  • Some error handling required for when the user is fighting the enemy regarding a valid input for different options the user can proceed with during the fight for example typing fight to fight back or typing heal to heal your health with a potion of some form. Currently at the moment is also damaged when typing an invalid input which I'm unsure if this is what is intended to happen. Perhaps displaying in the console of the required input for these different options instead of the user being available to endless opportunities and not punishing them for this
  • While inspecting the code, I have discovered that the enemies attacks have a guaranteed chance to nearly always be stronger than the players which seems unbalanced considering the introductory approach to fighting in this game which isn't fair for new users and perhaps easing the difficulty and increasing this overtime through the amount of fights the user beats
  • Was unable to close the game after I died with the program looping over itself endlessly with my health still ending up in the negatives. Consider developing a way for the user's health not to proceed into the negatives even after the user has taken the final hit from the enemy they were fighting
  • When the user is entering their name, they are free to type in anything they want as part of their name which while this gives them the freedom to be creative can lead to them misusing the name system to type any other data format other than strings where it is preferred for strings of characters to create real names.
  • At the moment, the user doesn't have the option to constantly view the description of the room they are in or the contents of their inventory which would I believe could be considered to benefit the user to incorporate a stat on the amount of damage a weapon does or any other collectibles available to the user perhaps when defeating the enemies
  • While the user takes the same path on the second round of fighting the enemy, the user is holding multiple instances of the same weapon which I don't believe was intended

Conclusion

  • In conclusion, I believe that this game is compact but is simple and effective with a variety of features and concepts with a intuitive battle turn based system but believe that improvements can be made to output informative info to the user including valid inputs the user needs to enter (e.g. type 'fight' to fight the enemy for example)

…oop. This means that while the respective code is running if there is an inapproprriate input the exception will be recognised and the error will be displayed to the user until they enter an appropriate input. I also made the boolean playing false when the user dies, so that the while playing loop ends when the user die allowing them to close the game.
…enemy are below 0 the health is not displayed. This means that the user cannot see the health if it is in the negatives.
…l as the inventory. If the user enters the appropriate input the description/inventory will be displayed. I also added an item string which varies depending on the user input while looting, this should allow the item to be used if required incase new needs from the game in the future.
…ecific parts of the code. I have also created a test class to return an error message and called this method of the class in a debug.Assert. Therefore whenever there is a certain bug the error message will appear.
…he room class includes 3 items. These items can then be initialized in the game class and displayed and added to inventory.
…r overwhelming, making it easier to read. I have also added logical or in if statements so that if a user enters a lowercase letter instead of capital it still runs. I also added the \n feature in some writeline statements so that it is not as overwhelming and easier to read in the terminal. I also added the items to the room class and defined them in the game class when the room was initialized. This will allow me to create different items for different rooms and easily reuse the items throughout the code.
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