Nebulocity Posted February 17, 2014 Share Posted February 17, 2014 Greetings. I'm placing objects (rectangle sprites) in my game that enemy sprites will collide with, but the behavior during collision seems odd. One of two things will happen:If the enemy sprite collides with the rectangle's sprite from the left or right, the enemy sprite and the rectangle will bounce away from each other. But if the enemy sprite collides with the rectangle from the left or right sides, it behaves normally: the enemy sprite and rectangle sprite both die.Does this make any sense to anyone? I don't understand why it would do anything but destroy both sprites, but it's only doing that half of the time...My collision code is here:Called by: game.physics.collide(enemies, rectangle, rectangleKill, null, this);Function: function collideEnemyRectangle(enemy, rectangle) { console.log("Enemy destroyed. Id: " + enemies.getIndex(enemy) + '. Score: ' + score); enemy.kill(); rectangle.kill(); updateScore(); } Link to comment Share on other sites More sharing options...
Syltaen Posted February 17, 2014 Share Posted February 17, 2014 This sould help http://www.html5gamedevs.com/topic/3733-custom-collision-callback-not-firing-fix/ Link to comment Share on other sites More sharing options...
Nebulocity Posted February 17, 2014 Author Share Posted February 17, 2014 Oh, thanks for referencing that! I'll wait until i can download 1.1.5 then. Link to comment Share on other sites More sharing options...
Nebulocity Posted February 18, 2014 Author Share Posted February 18, 2014 Nope, that didn't solve it. Any other ideas, anyone? Still the same behavior Link to comment Share on other sites More sharing options...
Recommended Posts