mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Tidying up and added physicsType.
This commit is contained in:
parent
beee4b90cf
commit
a7b93b3375
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,6 @@ var Class = require('../../utils/Class');
|
||||||
var CONST = require('./const');
|
var CONST = require('./const');
|
||||||
var GetFastValue = require('../../utils/object/GetFastValue');
|
var GetFastValue = require('../../utils/object/GetFastValue');
|
||||||
var Group = require('../../gameobjects/group/Group');
|
var Group = require('../../gameobjects/group/Group');
|
||||||
var PhysicsEvent = require('./events');
|
|
||||||
|
|
||||||
var PhysicsGroup = new Class({
|
var PhysicsGroup = new Class({
|
||||||
|
|
||||||
|
@ -31,6 +30,8 @@ var PhysicsGroup = new Class({
|
||||||
config.removeCallback = this.removeCallback;
|
config.removeCallback = this.removeCallback;
|
||||||
config.classType = ArcadeSprite;
|
config.classType = ArcadeSprite;
|
||||||
|
|
||||||
|
this.physicsType = CONST.DYNAMIC_BODY;
|
||||||
|
|
||||||
this.defaults = {
|
this.defaults = {
|
||||||
setCollideWorldBounds: GetFastValue(config, 'collideWorldBounds', false),
|
setCollideWorldBounds: GetFastValue(config, 'collideWorldBounds', false),
|
||||||
setAccelerationX: GetFastValue(config, 'accelerationX', 0),
|
setAccelerationX: GetFastValue(config, 'accelerationX', 0),
|
||||||
|
@ -49,7 +50,7 @@ var PhysicsGroup = new Class({
|
||||||
setAngularAcceleration: GetFastValue(config, 'angularAcceleration', 0),
|
setAngularAcceleration: GetFastValue(config, 'angularAcceleration', 0),
|
||||||
setAngularDrag: GetFastValue(config, 'angularDrag', 0),
|
setAngularDrag: GetFastValue(config, 'angularDrag', 0),
|
||||||
setMass: GetFastValue(config, 'mass', 1),
|
setMass: GetFastValue(config, 'mass', 1),
|
||||||
setImmovable: GetFastValue(config, 'immovable', false),
|
setImmovable: GetFastValue(config, 'immovable', false)
|
||||||
};
|
};
|
||||||
|
|
||||||
Group.call(this, scene, children, config);
|
Group.call(this, scene, children, config);
|
||||||
|
@ -59,7 +60,7 @@ var PhysicsGroup = new Class({
|
||||||
{
|
{
|
||||||
if (!child.body)
|
if (!child.body)
|
||||||
{
|
{
|
||||||
this.world.enableBody(child);
|
this.world.enableBody(child, CONST.DYNAMIC_BODY);
|
||||||
}
|
}
|
||||||
|
|
||||||
var body = child.body;
|
var body = child.body;
|
||||||
|
|
Loading…
Add table
Reference in a new issue