2013-06-26 04:44:56 +00:00
|
|
|
/// <reference path="../Game.ts" />
|
2013-06-13 16:15:16 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-26 04:44:56 +00:00
|
|
|
* Phaser - Physics Manager
|
2013-06-13 16:15:16 +00:00
|
|
|
*
|
2013-08-02 11:38:56 +00:00
|
|
|
* Eventually this will handle switching between the default ArcadePhysics manager or the new AdvancedPhysics manager.
|
|
|
|
* For now we direct everything through ArcadePhysics.
|
2013-06-13 16:15:16 +00:00
|
|
|
*/
|
|
|
|
|
2013-06-26 04:44:56 +00:00
|
|
|
module Phaser.Physics {
|
2013-06-13 16:15:16 +00:00
|
|
|
|
|
|
|
export class Manager {
|
|
|
|
|
|
|
|
constructor(game: Game) {
|
2013-08-02 11:38:56 +00:00
|
|
|
|
2013-06-13 16:15:16 +00:00
|
|
|
this.game = game;
|
2013-08-02 11:38:56 +00:00
|
|
|
|
|
|
|
this.arcade = new Phaser.Physics.ArcadePhysics(this.game, this.game.stage.width, this.game.stage.height);
|
|
|
|
|
|
|
|
this.gravity = this.arcade.gravity;
|
|
|
|
this.bounds = this.arcade.bounds;
|
|
|
|
|
2013-06-13 16:15:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Local reference to Game.
|
|
|
|
*/
|
|
|
|
public game: Game;
|
|
|
|
|
2013-08-02 11:38:56 +00:00
|
|
|
/**
|
|
|
|
* Instance of the ArcadePhysics manager.
|
|
|
|
*/
|
|
|
|
public arcade: Phaser.Physics.ArcadePhysics;
|
2013-06-21 22:39:29 +00:00
|
|
|
|
2013-08-02 11:38:56 +00:00
|
|
|
public gravity: Vec2;
|
|
|
|
public bounds: Rectangle;
|
2013-06-21 22:39:29 +00:00
|
|
|
|
2013-08-02 11:38:56 +00:00
|
|
|
/**
|
|
|
|
* Called by the main Game.loop
|
|
|
|
*/
|
2013-06-14 03:13:00 +00:00
|
|
|
public update() {
|
|
|
|
|
2013-08-02 11:38:56 +00:00
|
|
|
//this.arcade.updateMotion
|
|
|
|
|
2013-06-14 01:42:51 +00:00
|
|
|
}
|
|
|
|
|
2013-06-13 16:15:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|