Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Notepad++ create a new file called the_god_among_us_40.js -Do not use Html- 1. Implement the following functions: a. displayIntroduction: This function should take no arguments

Using Notepad++ create a new file called the_god_among_us_40.js

-Do not use Html-

1. Implement the following functions:

a. displayIntroduction: This function should take no arguments and display the introduction to your game.

b. getLeader: This function should prompt the user for their name and return it.

c. displayMenu: This function should display the menu.

d. doDamage: In Episode 2, you added options to your story that caused the player to lose lives. We're going to introduce the concept of player health. When the game starts, the player health should be 100. Rather than take an entire life, we want to do damage to the players health and take a life if their health falls below 100. This function should take the players current health as an argument, calculate the new health and return it to the caller. You can choose the amount of damage that is done. d. displayStats: This function displays the current player statistics.

3. Refactor your code to use the newly created functions.

4. Implement a module named inventory that will be responsible for managing the players inventory. The module should hold the array for the inventory and implement the following functions: a. displayInventory: Displays the current inventory

b. addToInventory: Adds an item to the inventory.

Apply the same rules to adding items as we did last week. Import your new module into the lost_fortune_40 program and replace the existing code with calls to the new module.

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

Why are there problems with implementation of the new software?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago