Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for JavaScript only. Create a script called battle.js. In this script code the following: A. Class and Constructor Creation (25 Points) Player Class

This is for JavaScript only.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Create a script called battle.js. In this script code the following: A. Class and Constructor Creation (25 Points) Player Class Create a constructor function or ES6 class for a Player object. The Player object should have the following properties Name: Holds the name of the player. Pass into the constructor. Health: Defaults to 10, do not pass into the constructor, just define and set to 10 in the constructor Strength: Defaults to 2 Weapons: An array of weapons objects. Should be passed into the constructor Weapon Class Create a constructor function or ES6 class for a Weapon object. It should have the following properties: Name: Holds the name of the weapon. Passed into the constructor. Damage: Defaults to a random number between 1 and 5, do not pass into the constructor, just define in the constructor and set it

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions