Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning 5.4 on August 3rd #1

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Turning 5.4 on August 3rd #1

wants to merge 26 commits into from

Conversation

marvinsantiago
Copy link
Owner

No description provided.

$('.game-screen').html(AppTemplates.battle(game));
});

$('.game-screen').on('click', '.attack-mode', function() {
Copy link

Choose a reason for hiding this comment

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

When the user clicks this will be after you have changed from the choose hero view to the battle screen so place this click handler inside of the click handler right after line 6.

@@ -0,0 +1,17 @@
{{#each this as |hero|}}
Copy link

Choose a reason for hiding this comment

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

Now that we have a single hero on our game object, we can get rid of these #each blocks

@@ -0,0 +1,17 @@
{{#each this as |hero|}}
<div class="hero-side">
<img src="images/{{ hero.imgURL }}" alt="{{ hero.name }}">
Copy link

Choose a reason for hiding this comment

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

Watch out when you capitalize things. <img src="images/{{ hero.imgUrl }}" alt="{{ hero.name }}"> Looks like you called it imgUrl on hero and imgURL on your enemy object.

},
}, Backbone.Events);

char = new Character({hitPoints: 200, weapons: {hammer: 20, sword: 15}});
Copy link

Choose a reason for hiding this comment

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

This line 35 and down can be deleted

Hero.prototype = _.extend({constructor: Hero}, Character.prototype);

var heroes = [
new Hero('Arrow', {hitPoints: 200, weapons: {arrow: 25, hands: 11}}, 'arrow.png'),
Copy link

Choose a reason for hiding this comment

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

Given your constructor, this can be:

new Hero('Arrow', 200, {arrow: 25, hands: 11}, 'arrow.png')

If we look at the Hero constructor it takes in the name, then health, then the weapons and finally the imgURL

Copy link
Owner Author

Choose a reason for hiding this comment

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

@rtablada Ok, i was kinda of confused with '{hitPoints: health, weapons: weapons}'

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.

None yet

2 participants