Skip to content

Commit bb574f9

Browse files
committed
Updated instructions for clarity
1 parent dfb8cee commit bb574f9

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

assignments/prototypes.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
/*
2-
Object oriented design is commonly used in video games. For this part of the assignment you will be implementing several constructor functions with their correct inheritance heirarchy.
2+
Object oriented design is commonly used in video games. For this part of the assignment you will be implementing several constructor functions with their correct inheritance hierarchy.
33
44
In this file you will be creating three constructor functions: GameObject, CharacterStats, Humanoid.
55
66
At the bottom of this file are 3 objects that all end up inheriting from Humanoid. Use the objects at the bottom of the page to test your constructor functions.
77
8-
Each constructor function has unique properites and methods that are defined in their block comments below:
8+
Each constructor function has unique properties and methods that are defined in their block comments below:
99
*/
1010

1111
/*
1212
=== GameObject ===
1313
* createdAt
14-
* dimensions
14+
* dimensions (These represent the character's size in the video game)
1515
* destroy() // prototype method -> returns the string: 'Object was removed from the game.'
1616
*/
1717

1818
/*
1919
=== CharacterStats ===
20-
* hp
20+
* healthPoints
2121
* name
2222
* takeDamage() // prototype method -> returns the string '<object name> took damage.'
2323
* should inherit destroy() from GameObject's prototype
2424
*/
2525

2626
/*
27-
=== Humanoid ===
28-
* faction
27+
=== Humanoid (Having an appearance or character resembling that of a human.) ===
28+
* team
2929
* weapons
3030
* language
3131
* greet() // prototype method -> returns the string '<object name> offers a greeting in <object language>.'
@@ -39,7 +39,7 @@
3939
* Instances of CharacterStats should have all of the same properties as GameObject.
4040
*/
4141

42-
// Test you work by uncommenting these 3 objects and the list of console logs below:
42+
// Test you work by un-commenting these 3 objects and the list of console logs below:
4343

4444
/*
4545
const mage = new Humanoid({
@@ -49,13 +49,13 @@
4949
width: 1,
5050
height: 1,
5151
},
52-
hp: 5,
52+
healthPoints: 5,
5353
name: 'Bruce',
54-
faction: 'Mage Guild',
54+
team: 'Mage Guild',
5555
weapons: [
5656
'Staff of Shamalama',
5757
],
58-
language: 'Common Toungue',
58+
language: 'Common Tongue',
5959
});
6060
6161
const swordsman = new Humanoid({
@@ -65,14 +65,14 @@
6565
width: 2,
6666
height: 2,
6767
},
68-
hp: 15,
68+
healthPoints: 15,
6969
name: 'Sir Mustachio',
70-
faction: 'The Round Table',
70+
team: 'The Round Table',
7171
weapons: [
7272
'Giant Sword',
7373
'Shield',
7474
],
75-
language: 'Common Toungue',
75+
language: 'Common Tongue',
7676
});
7777
7878
const archer = new Humanoid({
@@ -82,9 +82,9 @@
8282
width: 2,
8383
height: 4,
8484
},
85-
hp: 10,
85+
healthPoints: 10,
8686
name: 'Lilith',
87-
faction: 'Forest Kingdom',
87+
team: 'Forest Kingdom',
8888
weapons: [
8989
'Bow',
9090
'Dagger',
@@ -94,9 +94,9 @@
9494
9595
console.log(mage.createdAt); // Today's date
9696
console.log(archer.dimensions); // { length: 1, width: 2, height: 4 }
97-
console.log(swordsman.hp); // 15
97+
console.log(swordsman.healthPoints); // 15
9898
console.log(mage.name); // Bruce
99-
console.log(swordsman.faction); // The Round Table
99+
console.log(swordsman.team); // The Round Table
100100
console.log(mage.weapons); // Staff of Shamalama
101101
console.log(archer.language); // Elvish
102102
console.log(archer.greet()); // Lilith offers a greeting in Elvish.
@@ -105,6 +105,6 @@
105105
*/
106106

107107
// Stretch task:
108-
// * Create Villian and Hero constructor functions that inherit from the Humanoid constructor function.
109-
// * Give the Hero and Villians different methods that could be used to remove health points from objects which could result in destruction if health gets to 0 or drops below 0;
110-
// * Create two new objects, one a villian and one a hero and fight it out with methods!
108+
// * Create Villain and Hero constructor functions that inherit from the Humanoid constructor function.
109+
// * Give the Hero and Villains different methods that could be used to remove health points from objects which could result in destruction if health gets to 0 or drops below 0;
110+
// * Create two new objects, one a villain and one a hero and fight it out with methods!

0 commit comments

Comments
 (0)