Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions