Creating Classes and using Objects

In this assignment, we were tasked with creating a class representing a player in a game, and another class representing the game in which we should create multiple players with constructors. Because I was an idiot and started coding based off what we did that class (creating something akin to the Restaurant and Burger code), I was halfway done with a class entirely devoted to the player’s weapon before I realized that had nothing to do with the actual task.

There was no way I was deleting 30 minutes worth of work, so I ended up having 3 classes instead of 2: one for the player, one for their weapon, and one representing the game itself. There are 2 characters created in the class Game with preset parameters for both the player’s info and the weapon’s info, and I had the idea of importing a scanner to let the user input their desired parameters right after uploading my code to Github, but because I’m lazy and Github doesn’t like me much, I altered my code in BlueJ without reuploading it.

Below is the link to the codes in Github (please note that the classes “HelloWorld” and “Gundam” have nothing to do with this task – I simply created the classes in the Class Object project because that’s the key focus of this task):

Leave a Reply