Jump to content

Collision bounds on sprite?


Recommended Posts

So I have two sprites. One eats the other sprite. I've setup an overlap method

game.physics.arcade.overlap(playerFish, smallerFish, this.collisionHandler, null, this);

So when the bigger fish collides with the smallerfish the smaller fish dies and the bigger fish fires an animation, like so:

collisionHandler(body1, body2) {
    const runAnimTest = playerFish.animations.play('eat', 10, false);
    runAnimTest.onComplete.add(() => {
    }, this);

Basically, i kill the enemy sprite (body 2) and trigger eat animation on the fish sprite then oncomplete trigger the default swim animation.


Question, how/can I set the collision bounds on a sprite? So the eating animation triggers earlier so it looks more realistic at the moment the animation triggers too early and the animations look awful.



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...