Comments (4)
I ran into this problem as well but I've found a way to solve it. Following the webpack config pattern of the Phaser ES6 Webpack boilerplate, you could add this to the your webpack config file as a rule under module.rules
.
{
test: /phaser-arcade-slopes\.js$/,
use: [{
loader: 'expose-loader',
options: 'SAT'
}]
}
This exposes the SAT as a global variable using the expose-loader.
Make sure to import and register the Arcade Slopes plugin in your level file like so:
import ArcadeSlopes from 'phaser-arcade-slopes'
// in the create function
create () {
this.game.plugins.add(Phaser.Plugin.ArcadeSlopes)
}
Now you can use the plugin with a ES6 Webpack setup!
from phaser-arcade-slopes.
Nice! This will suffice until #41 is satisfied. :)
from phaser-arcade-slopes.
Shim happens here:
https://github.com/richardhealy/emagine/blob/master/helpers/shims/Phaser.js
from phaser-arcade-slopes.
As we discussed in the Phaser Slack, this is down to the plugin not being built for ES6. Seeing as you're only exporting Phaser there, the code will run but SAT will not be available globally (not everything is kept under one namespace).
This isn't something I'm looking to improve until an ES6 version of Phaser (Lazer) is released.
from phaser-arcade-slopes.
Related Issues (20)
- Automatically update sprite body polygons
- Remove the snap feature HOT 1
- Fix the wasTouching flags HOT 1
- Improve tunnelling HOT 12
- Ninja physics mapping for 64px+ HOT 1
- Fix skipped collisions between tiles HOT 3
- Prevent internal edge collisions without heuristics HOT 4
- AMD/UMD HOT 2
- Object pooling for calculations HOT 1
- Bodies not colliding HOT 2
- Automatically set colliding tiles for Tilemaps
- Drop Bower HOT 1
- Update npm package HOT 10
- Full-block tile in arcadeslopes not registering for collision HOT 4
- Using Slopes in Typescript HOT 20
- Question: How to prevent slipping or sliding on slopes HOT 1
- Curved slopes HOT 4
- Phaser 3 HOT 14
- Errors: "Unresolved slope type 'r' / Slope type r not defined", "tilemapLayer.getTileOffsetX is not a function" HOT 4
- Sprite jitters/bounces at some tile junctions HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phaser-arcade-slopes.