diff --git a/examples/attractorsPlugin.js b/examples/attractorsPlugin.js index ff1fc08b..7ee2497c 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 5ae63152..1b4cf4fe 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 a00d48f0..45779add 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 59af3103..eb5b3083 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())