0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-12 16:08:50 -05:00

change example matter-wrap require precedence

This commit is contained in:
liabru 2021-01-29 20:59:57 +00:00
parent 7bfd3c2b78
commit aa1e4e7738
2 changed files with 10 additions and 10 deletions

View file

@ -1,12 +1,12 @@
var Example = Example || {};
Example.avalanche = function() {
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
if (typeof MatterWrap !== 'undefined') {
// either use by name from plugin registry (Browser global)
Matter.use('matter-wrap');
} else {
// or require and use the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
}
var Engine = Matter.Engine,

View file

@ -1,12 +1,12 @@
var Example = Example || {};
Example.ballPool = function() {
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
if (typeof MatterWrap !== 'undefined') {
// either use by name from plugin registry (Browser global)
Matter.use('matter-wrap');
} else {
// or require and use the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
}
var Engine = Matter.Engine,