lukaMis Posted June 13, 2014 Share Posted June 13, 2014 Hi I have simple (for experienced Phasers at least) question. I am making simple lunar lander style game to get to know Phaser. So i load rocket image and rocket engine sprite than add them in to group and apply physics on the group. I am doing it like this so i only check collision with ground and rocket (so engine does not trigger collision). But i have problem with this engine of mine. When collision is detected engine keeps falling down. How would i disable that? here is link: http://demo.irokus.si/luka/lunarLanderDemo/ and code: http://demo.irokus.si/luka/lunarLanderDemo/js/lunarLander.js tnx a bunch have a nice dayLuka Link to comment Share on other sites More sharing options...
j0hnskot Posted June 14, 2014 Share Posted June 14, 2014 First change game.physics.enable(rocketGroup, Phaser.Physics.ARCADE); to game.physics.enable(rocket, Phaser.Physics.ARCADE);.Since you only need physics on the rocket there is no need to enable it on the whole group. Then try adding rocket.addChild(rocketEngine); This will make the rocket engine to move along with the rocket lukaMis 1 Link to comment Share on other sites More sharing options...
lukaMis Posted June 16, 2014 Author Share Posted June 16, 2014 @j0hnskot Tnx.I haven't found addChild in documentation and after you suggested it i found somewhere that it is from Pixi engine. Is this the way to go or something that should be avoided and used as a workaround? Luka Link to comment Share on other sites More sharing options...
j0hnskot Posted June 16, 2014 Share Posted June 16, 2014 I don't think there are problems using something from pixi since phaser is based on it. But i may be wrong. Link to comment Share on other sites More sharing options...
Recommended Posts