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 in 5.4 on August 1 #1

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

Turning in 5.4 on August 1 #1

wants to merge 17 commits into from

Conversation

jacklynlee31
Copy link
Owner

No description provided.

<body>

<div class="game">
<div class="start"></div>
Copy link

Choose a reason for hiding this comment

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

These start, battle, and end divs will be destroyed if you do $('.game').html(someVar).

$('.game').html(AppTemplates.start(heroes));

$('.start-name').click(function() {
$('.start').html(AppTemplates.battle());
Copy link

Choose a reason for hiding this comment

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

Don't change the HTML of the ".start" div. change all of the ".game"

@@ -0,0 +1,28 @@
function Hero(name, health, ability, imgUrl, spriteUrl) {
Copy link

Choose a reason for hiding this comment

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

You don't make your spriteUrl public in your constructor... :(

You'll need to add this.spriteUrl = spriteUrl.

// A User should see a start screen
$('.game').html(AppTemplates.start(heroes));

$('.start-name').click(function() {
Copy link

Choose a reason for hiding this comment

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

Change this to $('.start-name').on('click', function() {... The click function doesn't quite behave the same way that you would expect and can become confusing.

game.on('change', function() {
if (game.gameWin()) {
$('.game').html(AppTemplates.win(game));
} else {
Copy link

Choose a reason for hiding this comment

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

Should this be if (game.gameWin()) else if(game.gameLose()) else?

Right now you will always get a battle template

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