A Derpy Cat Posted January 24, 2018 Share Posted January 24, 2018 I am new to coding and I need to know how to make any object or sprite etc. immovable. Link to comment Share on other sites More sharing options...
mickeyren Posted January 28, 2018 Share Posted January 28, 2018 something like this works: // create a sprite without an image as a child of the skeleton var floor = game.add.sprite(0, 0, null); // enable physics so collision applies game.physics.arcade.enable(floor); // add a little offset so it's along where the skeleton is standing floor.anchor.setTo(0, -1); // create a floor long enough for the particle to land onto and not fall off floor.body.setSize(400, 1, -200); // we don't want the floor to move when the collision kicks in floor.body.immovable = true; You can see this in action here - https://www.programmingmind.com/phaser/stop-particles-from-sliding-in-phaser (my site) Link to comment Share on other sites More sharing options...
Recommended Posts