Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help making this game of Jurassic Conquest. I will be providing all the information needed below; PLEASE READ CAREFULLY!!! I NEED CODES!!!!!!!!! NEED
I need help making this game of "Jurassic Conquest".
The first thing to do is to implement an abstract class to represent a dinosaur. This is going to serve as the parent class for the inheritance we will be setting up. Use the following UML diagram to guide you on what this class will need: The following are implementation notes for the class: - You must separate the class into two files (specification and implementation) - All attributes are dynamic (meaning, you need to allocate and release their memory manually) - In the constructor, the a and b parameters need to initialize the x and y attributes, respectively - In the constructor, use true as the initial value for the alive attribute - Two dinosaurs are considered equal to each other if, and only if, their x and y values match up - The setDead method sets the alive attribute to fatse - The updateX method needs to do some validation on the x attribute - If adding 1 to x makes it negative, force x to be 0 - The updatex method needs to do some validation on the x attribute - If adding 1 to x makes it negative, force x to be 0 - If adding 1 to x makes it greater than 5 , force x to be 5 - Otherwise, g0 ahead and add 1 to x - The updater method is similar to updatex, just substituting the y attribute in instead The Four Children Classes The second task to complete is to create four classes that will be inheriting from Dinosaur. All children classes inherit using the pubtic access specifier. Use the following set of UML diagrams to guide you on what these classes will need: The following are implementation notes for these classes: - You must separate the class into two files (specification and implementation) - The constructor must explicilly call the parent constructor - Tyrannosaurus must pass the arguments 0 and 0 to the Dinosaur constructor (in that order) - Sreposaurus must pass the arguments 0 and 5 to the Dinosaur constructor (in that order) - Brachiosaurus must pass the arguments 5 and 0 to the Dinosaur constructor (In that order) - Chicken must pass the arguments 5 and 5 to the Dinosaur constructor (in that order) - The roar method must print out some kind of message (this is the battle cry for the dinosaurl) fight The third task to complete is to implement the fight function found in the utills.cpp file. This function is meant to contain the logic when two dinosaurs need to battle for their territory. You will need to iterate over the polymorphic array of pointers (called arr) to determine if any two dinosaurs are currently occupying the same square on the grid. If they are, here's what needs to happen: - Print the name and roar of each combatant dinosaur, so the user is aware of who is about to fight - Generate a random number so that - Print the name and roar of each combatant dinosaur, so the user is aware of who is about to fight - Generate a random number so that - There is a 60% chance that nothing happens - There is a 20% chance that dinosaur A attacks and defeats dinosaur B - There is a 20% chance that dinosaur B attacks and defeats dinosaur A - If an attack occurs, print that information so the user is aware Keep in my mind that only living dinosaurs can participate in battles (unfortunately, ghost dinosaurs can't fight). If a dinosaur is defeated in battle, you need to mark it as being dead. The fourth task to complete is to implement the isover function found in the utlls.cpp file. This function is tasked with figuring out if the battle for conquest is over. How do you know that? Simple: only one dinosaur can be left standing. You will need to traverse the polymorphic array of pointers (called arr) to determine if there is only one dinosaur left allve. Return true if that is indeed the case, otherwise return false. victoiryessage The final task to complete the homework assignment is to implement the victorilessage function found in the utils.cpp flle. This function is tasked with printing out a message claiming victory for the final dinosaur standing. You will need to traverse the polymorphic array of pointers (called arr) to find which dinosaur is still alive. Then, display the victory message of your choosing that utilizes the name and roar of the winning dinosaur. Sample Run Look through the sample run file that's included in this repository. You can use this as a model to aim for with your program I will be providing all the information needed below;
PLEASE READ CAREFULLY!!!
I NEED CODES!!!!!!!!!
NEED TO MAKE CPP files and HPP files!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started