Prompt: Create a virtual pet care game where players can choose a cute pet and then feed, train, or play-with it. The game is based on a simple game loop, where at the beginning of each loop, the game notifies the player of the current pet status (hungry, sleepy, bored, etc.) The player should then select the corresponding actions to improve the status of the pet. After each action, the game loop is repeated and the pet values are updated. The status should be displayed along with the corresponding messages as well as the menu of actions. Design Requirements: Implement the Pet class Create the base Pet class. It should manage variables that keep track of the pet's state, such as how hungry/sleepy/bored/happy the pet is currently. Include a function that updates the pet's state values to reflect the passage of time. If any of the variables are above some threshold (such as 40 out of 100), the function should output the corresponding message such as " is hungry!" Each Pet class should have a method to save and load all of its data onto or from a file, to allow the player to continue with an existing pet. Implement Types of Pets Create at least three (3) new child classes that inherits from the above Pet class. Implement the Game Loop After the game starts, the player should be presented with a menu to load a pet, or to create a new pet from the list of available pet types to choose from (perhaps with a brief description). After choosing a new pet type, the player should be asked to give it a name and it may be assigned some random starting attributes.
Prompt: Create a virtual pet care game where players can choose a cute pet and then feed, train, or play-with it. The game is based on a simple game loop, where at the beginning of each loop, the game notifies the player of the current pet status (hungry, sleepy, bored, etc.) The player should then select the corresponding actions to improve the status of the pet. After each action, the game loop is repeated and the pet values are updated. The status should be displayed along with the corresponding messages as well as the menu of actions.
Design Requirements: Implement the Pet class Create the base Pet class. It should manage variables that keep track of the pet's state, such as how hungry/sleepy/bored/happy the pet is currently. Include a function that updates the pet's state values to reflect the passage of time. If any of the variables are above some threshold (such as 40 out of 100), the function should output the corresponding message such as "<Pet name> is hungry!" Each Pet class should have a method to save and load all of its data onto or from a file, to allow the player to continue with an existing pet.
Implement Types of Pets Create at least three (3) new child classes that inherits from the above Pet class.
Implement the Game Loop After the game starts, the player should be presented with a menu to load a pet, or to create a new pet from the list of available pet types to choose from (perhaps with a brief description). After choosing a new pet type, the player should be asked to give it a name and it may be assigned some random starting attributes.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 7 images