Question: Create an array where each slot is 2 integers. These represent the health and strength of an object in our game. The first pair of

Create an array where each slot is 2 integers. These represent the health and strength of an object in our game. The first pair of integers will be the health and strength of our player.
We are going to use MIPS syscall instruction 41(or 42) to randomly assign values for these integers. The player should have a random strength between 5 and 12 and a random health of between 25 and 50.
There will be three monsters in our array. They will also have a random strength and health with a range from (1)/(3) of the players health/strength up to 110% the players health/strength respectively.
This means the array will have a total of 8 slots.
The main game loop will the commence and will have the following characteristics:
Display the player and monster strength/health (only for monsters whose health >0)
The player will be able to attack or heal.
If attacking, the player will attack the first monster whose health is >0 by subtracting the players strength from the monsters health.
if healing, you will add the players strength to their health.
The monster will have a 50% chance of attacking by using instruction 41(or 42) between any two number ranges. With a result of one of those numbers meaning they will attack.
The loop ends when the players health <=0 or ALL the monsters health <=0
You will want to make extensive use of subroutines!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!