xyruleib Posted May 26, 2015 Share Posted May 26, 2015 I'm moving the character through tween, because I want to move it tile by tile.But with so I am unable to do collide with coins.I would like to make when it passes on a tile that has coin, the coin is caught (coin.kill(); addScore(). Link to comment Share on other sites More sharing options...
fariazz Posted May 27, 2015 Share Posted May 27, 2015 Even if an element is moving on a tween, normal overlap checks done in the update method should still work. In your state:update: function() { //assuming this.coins is a group with all the coins this.game.physics.arcade.overlap(this.player, this.coins, this.grabCoin, null, this);},grabCoin: function(player, coin) { coin.kill(); this.addScore();} xyruleib 1 Link to comment Share on other sites More sharing options...
xyruleib Posted May 28, 2015 Author Share Posted May 28, 2015 Thank youu @fariazz!! I was trying to collide() instead of overlap() fariazz 1 Link to comment Share on other sites More sharing options...
Recommended Posts