Jump to content

Collision Between Circle and sprite ?


Nikow
 Share

Recommended Posts

Hi everybody !

 

I'm trying to make a space game, so i need to have a collision between my spaceship and the planet, i try this :

circle = game.add.graphics(0, 0);circle.beginFill(0xFF0000, 0.3);circle.drawCircle(0, 0, 305);planetCircle = game.add.sprite(game.width/2, game.height/2);planetCircle.addChild(circle);game.physics.enable(planetCircle, Phaser.Physics.ARCADE);planetCircle.body.immovable = true;fusee = this.game.add.sprite(game.width/2,10,"fusee");game.physics.enable(fusee, Phaser.Physics.ARCADE);fusee.anchor.setTo(0.5,1);game.physics.arcade.collide(fusee, planetCircle);

But the ship cross through the planet :/

Is it a limit of Phaser.Physics.ARCADE ??

 

Thanks !

Link to comment
Share on other sites

The ship not colliding with the planet is a problem.

But wanting a circle body shape in the ARCADE physic engine is a bigger problem.

 

If you want bodies that are not rectangles or squares, use the P2 physic engine.

 

That was i thought ... !

Thanks ;)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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