-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
…ge to battle screen
…screen stopped working
$('.game-screen').html(AppTemplates.battle(game)); | ||
}); | ||
|
||
$('.game-screen').on('click', '.attack-mode', function() { |
There was a problem hiding this comment.
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.
…. Also added character.js to Brocfile.js
@@ -0,0 +1,17 @@ | |||
{{#each this as |hero|}} |
There was a problem hiding this comment.
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 }}"> |
There was a problem hiding this comment.
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}}); |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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}'
No description provided.