Challenge: Prototype Pattern
Explore how to apply the prototype pattern in JavaScript by creating a Ninja fighting game. Understand object creation and method sharing to control game logic involving punches and kicks. Develop your skills to handle conditions and update ninja points efficiently.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you have to implement a Ninja fighting game using the prototype pattern.
You have already been given the Ninja constructor function, which will be used to create a ninja object. A ninja should have the following properties:
-
name -
points
The points are set to 100 by default upon the instantiation of a ...