Ask coding questions

← Back to all posts
plz help there are errors with line 40-49, everything else, I'm so crap
Salman767XD (0)

here is the project question parts

In Super Mario 3D World, there are one playable characters; Mario. He has his own inventory which stores the following powers:
- Mushroom
- Super Bell
- Boomerang
- Fire Flower
He will start the game with 5 of each. After selecting his character, Mario can see how much is in each inventory by going to the inventory screen which displays something like this:
MARIO'S INVENTORY
POWER AMOUNT
Mushroom 5
Super Bell 5
Boomerang 5
Fire Flower 5

part 2:
In Super Mario 3D World, before starting a level, the player is prompted to take some powers with them into the level or if they want to purchase additional powers.

Create a prompt which simply asks the player this question and allows the player to respond. Nothing else should be added.

Part 3:
In Super Mario 3D World, when a player is prompted to take/purchase a power, they should be asked to enter the name of the power.

The program which repeat this prompt if they enter a power which doesn't exist or if this power has no more items left in the inventory.

The program will then ask how many they want to take (or how many they want to purchase)

Create a subroutine which does this, then apply this with the code you created in Super Mario Part 2.

part 4:
In Super Mario 3D World, when a player selects a power, the amount in the inventory needs to be changed:
- If they selected to take powers, the amount should be reduced by however many they entered
- If they selected to purchase powers, the amount should be increased by however many they entered.

Taking all of your code so far from Super Mario Part 1 to Super Mario Part 3, create the program described above.

part 5:

When choosing powers to use in the game, users state how many they want to use. If the amount they selected is available, update the remaining inventory display.

all parts have been done by me except part 5. just give some hints or advice to fix the errors. I think it is a logic error. thanks. if you don't want to be bothered then don't.

PLZ HELP

Comments
hotnewtop
RYANTADIPARTHI (6021)

everything seems good. No errors. What do you need help with?