From 3ae8fb12916ff42f273529729bb3ef09f4a3d0d1 Mon Sep 17 00:00:00 2001 From: Garrett Finucane Date: Thu, 31 Jul 2014 16:55:56 -0400 Subject: [PATCH] fixed highscore doubling? --- js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index bf505ca..9e8e26f 100644 --- a/js/main.js +++ b/js/main.js @@ -293,7 +293,9 @@ function isInfringing(hex){ function checkGameOver() { for (var i = 0; i < MainHex.sides; i++) { if (isInfringing(MainHex)) { - highscores.push(score); + if(highscores.indexOf(score) == -1){ + highscores.push(score); + } writeHighScores(); gameOverDisplay(); return true;