tonky Posted May 4, 2016 Share Posted May 4, 2016 this.head.body.setBodyContactCallback(this.groundBody, this.resetGame, this); resetGame: function(a, b, f1, f2, begin){ if (!begin) { return; } if (begin) { if (SideScroller.TRIES_LEFT === 0) { console.log('over'); } else { console.log('tries not zero'); } } }, The code in reset() is running multiple times. So for example, I get console.log('tries not zero'); in console, 3 or 5 times instead of just once. How can I fix this pls? Link to comment Share on other sites More sharing options...
Recommended Posts