Jump to content

sword hitting a group


ramrumram
 Share

Recommended Posts

I am new to phaser, I have added an animation with a 'j' key to swing sword , but I need to catch the collision with the 'tree' group when I hit 'J'

I am trying this with phaser 2 but not sure where should I put the arcade.collide..

 

Any help is appreciated.

Quote

 

function update() {
    if (jKey.isDown) {
            player.animations.play("thrust");

              game.physics.arcade.collide(player, trees,  function(player, tree) {
            console.log('works');
           });
    }

     
}

 

 

Screen Shot 2018-12-26 at 1.31.26 PM.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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