Answered step by step
Verified Expert Solution
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.
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 itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started