Commit 6c1b291e authored by wildfirecode13's avatar wildfirecode13

1

parent e2806289
This diff is collapsed.
...@@ -94,7 +94,9 @@ ...@@ -94,7 +94,9 @@
}; };
GameView.prototype.setup = function () { GameView.prototype.setup = function () {
console.log('setup'); console.log('setup');
var world = new p2.World({}); var world = new p2.World({
gravity: [0, -20],
});
world.sleepMode = p2.World.BODY_SLEEPING; world.sleepMode = p2.World.BODY_SLEEPING;
var planeShape = new p2.Plane(); var planeShape = new p2.Plane();
var planeBody = new p2.Body(); var planeBody = new p2.Body();
......
This diff is collapsed.
...@@ -116,7 +116,7 @@ export default class GameView extends engine.Container { ...@@ -116,7 +116,7 @@ export default class GameView extends engine.Container {
//创建world //创建world
var world: p2.World = new p2.World({ var world: p2.World = new p2.World({
// gravity: [0, 0], gravity: [0, -10],
}); });
world.sleepMode = p2.World.BODY_SLEEPING; world.sleepMode = p2.World.BODY_SLEEPING;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment