Skip to content

Commit dd68b6a

Browse files
committed
Added PhysicsManager and tidied things up
1 parent 13a2407 commit dd68b6a

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

v3/src/scene/Systems.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ var GameObjectCreator = require('../plugins/GameObjectCreator');
99
var GameObjectFactory = require('../plugins/GameObjectFactory');
1010
var InputManager = require('../plugins/InputManager');
1111
var Loader = require('../plugins/Loader');
12+
var PhysicsManager = require('../plugins/PhysicsManager');
1213
var PoolManager = require('../plugins/PoolManager');
14+
var SceneManager = require('../plugins/SceneManager');
1315
var Settings = require('./Settings');
1416
var StableSort = require('../utils/array/StableSort');
15-
var SceneManager = require('../plugins/SceneManager');
1617
var TweenManager = require('../tween/TweenManager');
1718
var UpdateList = require('../plugins/UpdateList');
1819

@@ -30,7 +31,6 @@ var Systems = new Class({
3031
this.sortChildrenFlag = false;
3132

3233
// Set by the GlobalSceneManager
33-
this.mask = null;
3434
this.canvas;
3535
this.context;
3636

@@ -46,19 +46,18 @@ var Systems = new Class({
4646
// Reference to Scene specific managers (Factory, Tweens, Loader, Physics, etc)
4747
this.add;
4848
this.cameras;
49+
this.data;
50+
this.displayList;
4951
this.events;
5052
this.inputManager;
5153
this.load;
5254
this.make;
55+
this.physicsManager;
5356
this.pool;
5457
this.sceneManager;
5558
this.time;
5659
this.tweens;
57-
58-
// Scene properties
5960
this.updateList;
60-
this.displayList;
61-
this.data;
6261
},
6362

6463
init: function (game)
@@ -74,27 +73,27 @@ var Systems = new Class({
7473
this.registry = game.registry;
7574
this.textures = game.textures;
7675

77-
// Scene specific properties (transform, data, children, etc)
78-
79-
this.inputManager = new InputManager(scene, game);
80-
this.updateList = new UpdateList(scene);
81-
this.displayList = new DisplayList(scene);
82-
this.data = new Data(scene);
83-
8476
// Scene specific managers (Factory, Tweens, Loader, Physics, etc)
8577

8678
this.add = new GameObjectFactory(scene);
8779
this.cameras = new CameraManager(scene);
80+
this.data = new Data(scene);
81+
this.displayList = new DisplayList(scene);
8882
this.events = new EventDispatcher();
83+
this.inputManager = new InputManager(scene);
8984
this.load = new Loader(scene);
9085
this.make = new GameObjectCreator(scene);
86+
this.physicsManager = new PhysicsManager(scene);
9187
this.pool = new PoolManager(scene);
92-
this.sceneManager = new SceneManager(scene, game);
88+
this.sceneManager = new SceneManager(scene);
9389
this.time = new Clock(scene);
9490
this.tweens = new TweenManager(scene);
91+
this.updateList = new UpdateList(scene);
9592

9693
// Sometimes the managers need access to a system created after them
94+
this.add.boot();
9795
this.inputManager.boot();
96+
this.physicsManager.boot();
9897

9998
this.inject();
10099
},
@@ -130,6 +129,8 @@ var Systems = new Class({
130129
this.tweens.begin(time);
131130
this.inputManager.begin(time);
132131

132+
this.physicsManager.update(time, delta);
133+
133134
this.pool.update(time, delta);
134135
this.updateList.update(time, delta);
135136
this.time.update(time, delta);

0 commit comments

Comments
 (0)