Added showBody and showVelocity as config options

This commit is contained in:
Richard Davey 2017-08-16 23:14:30 +01:00
parent 67cba936da
commit 15a749d8ea
2 changed files with 4 additions and 2 deletions

View file

@ -55,8 +55,8 @@ var Body = new Class({
this.checkAgainst = TYPE.NONE;
this.collides = COLLIDES.NEVER;
this.debugShowBody = true;
this.debugShowVelocity = true;
this.debugShowBody = world.defaults.debugShowBody;
this.debugShowVelocity = world.defaults.debugShowVelocity;
this.debugBodyColor = world.defaults.bodyDebugColor;
// min 44 deg, max 136 deg

View file

@ -40,6 +40,8 @@ var World = new Class({
this.debugGraphic;
this.defaults = {
debugShowBody: GetFastValue(config, 'debugShowBody', true),
debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true),
bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff),
velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00),
maxVelocityX: GetFastValue(config, 'maxVelocityX', 100),