Skip to content

initial commit - #1

Merged
mattshardman merged 7 commits into
masterfrom
pascal-ulor
May 9, 2019
Merged

mattshardman merged 7 commits into
masterfrom
pascal-ulor

Conversation

@PascalUlor

@PascalUlor PascalUlor commented May 8, 2019 •

Copy link
Copy Markdown
Owner

What does this PR do?

1. add name to README file
2. deliver Javascript 3 project
3. implement the "this" keyword

Description of Task to be completed?

1. create and manipulate javascript constructors
2. manipulate javascript prototypes
3. create a game with javascript objects

How should this be manually tested?

1. clone this repo
2. cd into lambda-3-3/assignment
3. open index.html file in any browser of choice

or

1. clone this repo
2. cd into lambdajs-3-3/assignment
3. open terminal and run: node filename

Any background context you want to provide?

Ensure node is well installed to test code on terminal

PascalUlor added 7 commits May 8, 2019 13:57
add name to README file
uncomment the game instances
create GameObject method
create CharacterStats prototypes and instances
create Humanoid prototypes
create hero and villian object
create game function ref-(Ikechukwu combat function)
Comment thread assignments/prototypes.js
person.healthPoints -= 10;
return `${person.name} health point is now ${person.healthPoints}`
}
}

@mattshardman mattshardman May 9, 2019 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As these two prototypes are exactly the same it's possible to create a separate function and assign it to the attack prototype of hero and villain, something like this:

Hero.prototype = { ...Humanoid.prototype, attackFunction };

This helps keep the code DRY

@mattshardman

Copy link
Copy Markdown
Collaborator

Great job Pascal

  • You have correctly created the required objects using constructor functions
  • Your constructors are correctly inherit from each other
  • Your git workflow is clean and fluid
  • You code is well organised and easy to read
  • You have tackled the stretch challenge and created a villain

Overall great job you clearing have a good understanding of constructor functions and prototypal inheritance. Keep it up!

@mattshardman
mattshardman merged commit 9ab9e21 into master May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants