Nikow Posted March 20, 2015 Share Posted March 20, 2015 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 More sharing options...
mwatt Posted March 20, 2015 Share Posted March 20, 2015 I'd suggest making your circle an image and load it into a sprite. Then you can do standard collision checking. Link to comment Share on other sites More sharing options...
ZoomBox Posted March 20, 2015 Share Posted March 20, 2015 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. Link to comment Share on other sites More sharing options...
mwatt Posted March 20, 2015 Share Posted March 20, 2015 Good point. I do collision checking with circles using arcade but they are very small and moving rapidly, so it is a forgiving check. A large circle would be a problem. Link to comment Share on other sites More sharing options...
Nikow Posted March 20, 2015 Author Share Posted March 20, 2015 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 More sharing options...
Recommended Posts