beanymanuk Posted May 4, 2010 Share Posted May 4, 2010 Hi I am trying to build this HTML 5 snake game buts the scoring part of the game does not work in firefox anyone know why not? http://blog.new-bamboo.co.uk/2009/12/30/html5-canvas-snake-game Think its around this part of the code function updateScore(){ var score = (snakeLength - 3)*10 document.getElementById('score').innerText = score; } Anyone got any ideas? game here try in Firefox and score does not increase but in Chrome it does http://snake.heroku.com/ Thankyou in advance Quote Link to comment Share on other sites More sharing options...
Alex Posted May 4, 2010 Share Posted May 4, 2010 You're missing a semicolon. var score = (snakeLength - 3)*10; Quote Link to comment Share on other sites More sharing options...
beanymanuk Posted May 4, 2010 Author Share Posted May 4, 2010 Good spot that never noticed that was missing. Still the same though score not updating Quote Link to comment Share on other sites More sharing options...
Alex Posted May 4, 2010 Share Posted May 4, 2010 You were actually missing that in two places. You fixed it in your gameOver function, but not in your updateScore function. Quote Link to comment Share on other sites More sharing options...
beanymanuk Posted May 4, 2010 Author Share Posted May 4, 2010 figured out what was wrong in the end WRONG document.getElementById('score').innerText = score; RIGHT document.getElementById("score").innerHTML = score; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.