Open cbotwell opened 8 years ago
:link: Corbin's 5.4 Pull Request
@cbotwell in general, you are having to do a lot of $().html() for every attribute on the page.
Since you have an instance of Game
, which has your hero
, enemy
, and turns
you could instead make it so that you send this game object to the template and then you can just rerender the entire game board any time things change.
This does make one problem: you will have to set your click handlers on the .game-target
div and provide a selector
to the on
function from jQuery so that you don't have to redeclare your click handlers every time you render the battle screen.
As for checking on the game over status, try adding a isGameOver
to your Game.prototype
. This would allow you to check
if (game.isGameOver()) {
// render end screen
} else {
// re-render battle screen
}
Also if the game had a function called chooseAttack
then the game object could set the attack on the player, make the AI attack and then send an event saying that it is ready for user input again.
:link: Corbin's 5.4 GH Page
Still having issues with:
Additional goals:
@cbotwell let's set up a time so we can look at the hard mode requirements and the health percentage
Deliverables
Requirements
Normal Mode
Hard Mode
weapons
andgetAttackStrength
from our example in class)