Yuri Posted November 7, 2015 Share Posted November 7, 2015 Below is the code I used to create the floor in Panda.js v1.x The issue I seem to be having in 2.x is that the floor is now affected by physics/gravity and falls down. How could I make it stick in place?this.world = new game.World(0, 2500);var floorBody = new game.Body({ position: { x: game.system.width / 2, y: game.system.height }, collisionGroup: 1});var floorShape = new game.Rectangle(game.system.width, 50);floorBody.addShape(floorShape);this.world.addBody(floorBody); Quote Link to comment Share on other sites More sharing options...
Yuri Posted November 12, 2015 Author Share Posted November 12, 2015 It does work by creating the game world with 0 gravity but is there another way? Quote Link to comment Share on other sites More sharing options...
Legomite Posted December 19, 2015 Share Posted December 19, 2015 UsefloorBody.static = trueI think it disables movement of a physics body, hope it helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.