diff --git a/examples/attractorsPlugin.js b/examples/attractorsPlugin.js index ff1fc08..7ee2497 100644 --- a/examples/attractorsPlugin.js +++ b/examples/attractorsPlugin.js @@ -57,6 +57,8 @@ Matter.Plugin.register(MatterAttractors); - window.MatterAttractors = MatterAttractors; + if (typeof window !== 'undefined') { + window.MatterAttractors = MatterAttractors; + } })(); diff --git a/examples/gravityPlugin.js b/examples/gravityPlugin.js index 5ae6315..1b4cf4f 100644 --- a/examples/gravityPlugin.js +++ b/examples/gravityPlugin.js @@ -41,6 +41,8 @@ Matter.Plugin.register(MatterGravity); - window.MatterGravity = MatterGravity; + if (typeof window !== 'undefined') { + window.MatterGravity = MatterGravity; + } })(); diff --git a/examples/wrapPlugin.js b/examples/wrapPlugin.js index a00d48f..45779ad 100644 --- a/examples/wrapPlugin.js +++ b/examples/wrapPlugin.js @@ -65,6 +65,8 @@ Matter.Plugin.register(MatterWrap); - window.MatterWrap = MatterWrap; + if (typeof window !== 'undefined') { + window.MatterWrap = MatterWrap; + } })(); diff --git a/test/node/TestDemo.js b/test/node/TestDemo.js index 59af310..eb5b308 100644 --- a/test/node/TestDemo.js +++ b/test/node/TestDemo.js @@ -162,7 +162,8 @@ var getDemoNames = function() { skip = [ 'terrain', 'svg', 'concave', 'slingshot', 'views', 'raycasting', - 'events', 'collisionFiltering', 'sleeping' + 'events', 'collisionFiltering', 'sleeping', + 'attractors' ]; $('#demo-select option', fs.readFileSync('demo/index.html').toString())