-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thursday July 30, 2015 #1
Conversation
currentEnemy = game.enemy; | ||
turn = game.turnNumber; | ||
|
||
newBattle(); |
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.
The point of having a game
object is so that it stores and manages your hero, enemy, turn number, etc.
Try to pass your game
as an argument to the newBattle
function and this will clear up the currentHero
, currentEnemy
variables everywhere.
game.turnNumber++; | ||
}); | ||
|
||
if (game.turnNumber % 2 === 1) { |
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.
Line 57 through 68 will only run once when newBattle
if run, if you want the turn stuff to run each time the player clicks on attack, my advise would be to put this inside of the on('click'
that starts on line 48.
馃搨 Starting Project