assets/Javascript/game.js
// This function will reset the state of the game
This function will reset the state of the game
This function will reset the state of the game
function resetGame() {
  $("#luke-skywalker").children(".health").html(lukeSkywalker.health);
  $("#yoda-character").children(".health").html(yoda.health);
  $("#darth-vader-character").children(".health").html(darthVader.health);
  $("#stormtrooper-character").children(".health").html(stormTrooper.health);
  $(".character-image").removeClass("chosen-character enemy-character defender-character").addClass("available-character");
  var available = $(".available-character").show();
  $("#characters-available").html(available);
  $("#game-message").empty();
  $("#restart").hide();
  characterSelected = false;
  defenderSelected = false;
  enemiesDefeated = 0;
  gameOver = false;
  character = {};
  defender = {};
}
function resetGame ( ) { $ ( "#luke-skywalker" ) . children ( ".health" ) . html ( lukeSkywalker . health ) ; $ ( "#yoda-character" ) . children ( ".health" ) . html ( yoda . health ) ; $ ( "#darth-vader-character" ) . children ( ".health" ) . html ( darthVader . health ) ; $ ( "#stormtrooper-character" ) . children ( ".health" ) . html ( stormTrooper . health ) ; $ ( ".character-image" ) . removeClass ( "chosen-character enemy-character defender-character" ) . addClass ( "available-character" ) ; var available = $ ( ".available-character" ) . show ( ) ; $ ( "#characters-available" ) . html ( available ) ; $ ( "#game-message" ) . empty ( ) ; $ ( "#restart" ) . hide ( ) ; characterSelected = false ; defenderSelected = false ; enemiesDefeated = 0 ; gameOver = false ; character = { } ; defender = { } ; }
This function will reset the state of the game
This function will reset the state of the game
// Reset all the health values to the original