joshbivens Posted November 19, 2015 Share Posted November 19, 2015 I added a 'restart' icon that runs a restart function when clicked, but if you click it at any time before the 'Game Over' screen, it restarts just fine but after a second the lives counter goes down by one. The only delay timer I have is the Webfonts loader, so I'm confused. The project in question: https://github.com/joshbivens/breakout-pipboyThanks for your time! Link to comment Share on other sites More sharing options...
Skeptron Posted November 20, 2015 Share Posted November 20, 2015 I suspect this is due to the fact that you don't restart a game state, you manually 'restart' everything. So maybe the ball from your previous game session still does exist, goes out of bounds and causes you to lose a life. You should use a Game State, and basically just restart it. The code would be much easier, shorter, and guaranteed to work. Link to comment Share on other sites More sharing options...
joshbivens Posted November 20, 2015 Author Share Posted November 20, 2015 I suspect this is due to the fact that you don't restart a game state, you manually 'restart' everything. So maybe the ball from your previous game session still does exist, goes out of bounds and causes you to lose a life. You should use a Game State, and basically just restart it. The code would be much easier, shorter, and guaranteed to work. Thank you very much. Link to comment Share on other sites More sharing options...
Skeptron Posted November 20, 2015 Share Posted November 20, 2015 Did you even fix your issue? Don't mark my post as answer just because I helped Link to comment Share on other sites More sharing options...
Recommended Posts