mirror of
https://github.com/wassname/phaser.git
synced 2026-08-11 11:23:06 +08:00
Integrating p2.js.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2014 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class Phaser.Physics
|
||||
*/
|
||||
Phaser.Physics = {};
|
||||
|
||||
/**
|
||||
* @class Phaser.Physics.World
|
||||
* @classdesc Physics World Constructor
|
||||
* @constructor
|
||||
* @param {Phaser.Game}
|
||||
*/
|
||||
Phaser.Physics.World = function (game) {
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} game - Local reference to game.
|
||||
*/
|
||||
this.game = game;
|
||||
|
||||
p2.World.call(this);
|
||||
|
||||
};
|
||||
|
||||
Phaser.Physics.World.prototype = Object.create(p2.World.prototype);
|
||||
Phaser.Physics.World.prototype.constructor = Phaser.Physics.World;
|
||||
|
||||
/**
|
||||
* @method Phaser.Physics.World.prototype.update
|
||||
*/
|
||||
Phaser.Physics.World.prototype.update = function () {
|
||||
|
||||
this.step(1 / 60);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user