Jirka1111 Posted August 28, 2014 Share Posted August 28, 2014 This is my last problem with game (Don't touch the spikes copy). Everything is fine in Chrome, but sometimes my bird touch world bounds on the right side twice. I check touching with GAME_WIDTH - 40 which is width of the bird. If he touch the right side, he just bounce and score is +1 (but if error shows up, then score is +2). In update: if(this.bird.body.x >= Bird.GAME_WIDTH - 40){ Bird.score += 1; this.addLeftSpikes(); this.rightSideSpikes.removeAll(); Bird.scoreText.setText("score: " + Bird.score); this.coin.play(); this.bird.scale.x = -1; } Link to comment Share on other sites More sharing options...
Jirka1111 Posted August 28, 2014 Author Share Posted August 28, 2014 Anybody with same problem? It happened twice. With two different versions of Phaser. Link to comment Share on other sites More sharing options...
Jirka1111 Posted August 28, 2014 Author Share Posted August 28, 2014 I think I've solved it. I had GAME_WIDTH - 40 (it is width of my sprite). I just had to switch 40 for sprite.width. Link to comment Share on other sites More sharing options...
Recommended Posts