nkholski / phaser3-es6-webpack Goto Github PK
View Code? Open in Web Editor NEWGeneric platformer and Phaser 3 bootstrap project
Home Page: http://metroid.niklasberg.se/phaser3platformer/
Generic platformer and Phaser 3 bootstrap project
Home Page: http://metroid.niklasberg.se/phaser3platformer/
Steps:
npm install
npm run deploy
[email protected] deploy D:\work\phaser3\phaser3-es6-webpack
webpack --config webpack.production.config.js
Hash: 379fbc1d51360dac6cca
Version: webpack 3.8.1
Time: 6704ms
Asset Size Chunks Chunk Names
bundle.js 119 kB 0 [emitted] app
vendor.bundle.js 2.73 MB 1 [emitted] [big] vendor
[134] (webpack)/buildin/global.js 488 bytes {1} [built]
[506] ./src/sprites/Enemy.js 4.45 kB {0} [built]
[507] multi babel-polyfill ./src/main.js 40 bytes {0} [built]
[710] ./src/main.js 649 bytes {0} [built]
[831] (webpack)/buildin/module.js 495 bytes {1} [built]
[1350] ./src/MarioBrosScene.js 18.6 kB {0} [built]
[1351] ./src/sprites/Mario.js 10.1 kB {0} [built]
[1352] ./src/sprites/Goomba.js 3.78 kB {0} [built]
[1353] ./src/sprites/Turtle.js 4.54 kB {0} [built]
[1354] ./src/sprites/PowerUp.js 4.98 kB {0} [built]
[1355] ./src/sprites/SMBTileSprite.js 3.45 kB {0} [built]
[1356] ./src/helpers/animations.js 5.32 kB {0} [built]
[1357] multi phaser 28 bytes {1} [built]
+ 1345 hidden modules
ERROR in vendor.bundle.js from UglifyJs
Unexpected token: name (fov) [vendor.bundle.js:41229,12]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] deploy: webpack --config webpack.production.co nfig.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
But in the live demo it does not happen. Only thing i did was npm install and run dev.
Is there a way to add obfuscation to this?
Thanks
What does it typically mean when I recieved a warning in Google Chrome console that states the following as the game loads into my browser?
phaser.js:28424 Texture.frame missing: mario/bendSuper
I'm recieving that message right now and not sure how to resolve it...
npm run dev works fine :-)
npm run deploy fails:
ERROR in multi pixi p2 phaser webfontloader
Module not found: Error: Can't resolve 'p2' in 'phaser3-es6-webpack'
@ multi pixi p2 phaser webfontloader
ERROR in multi pixi p2 phaser webfontloader
Module not found: Error: Can't resolve 'phaser' in 'phaser3-es6-webpack'
@ multi pixi p2 phaser webfontloader
ERROR in ./src/main.js
Module not found: Error: Can't resolve 'phaser' in 'phaser3-es6-webpack/src'
@ ./src/main.js 3:0-17
@ multi babel-polyfill ./src/main.js
ERROR in multi pixi p2 phaser webfontloader
Module not found: Error: Can't resolve 'pixi' in 'phaser3-es6-webpack'
@ multi pixi p2 phaser webfontloader
npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "deploy"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] deploy: webpack --config webpack.production.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] deploy script 'webpack --config webpack.production.config.js'.
In webpack.production.config.js
// Phaser webpack config
var phaserModule = path.join(__dirname, '/node_modules/phaser-ce/')
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js')
var pixi = path.join(phaserModule, 'build/custom/pixi.js')
var p2 = path.join(phaserModule, 'build/custom/p2.js')
Build folder doesn't exist
Comments had not been removed in production mode, thus output javascript file size is very large.
Phaser3 use optimization to run UglifyJSPlugin, to remove comments.
Would you know the best way to disable unused variable removal during dev? I need it for debugging.
For example I could have a variable initialed to number or an object, but never used.
I suspect it is the
new HtmlWebpackPlugin({
filename: '../index.html',
template: './src/index.html',
chunks: [ 'vendor', 'app' ],
chunksSortMode: 'manual',
minify: {
removeAttributeQuotes: false,
collapseWhitespace: false,
html5: false,
minifyCSS: false,
minifyJS: false,
minifyURLs: false,
removeComments: false,
removeEmptyAttributes: false
},
hash: false
}),
Thanks!
This is probably "out of scope" for the purpose of this project, but I just thought I'd make a quick note of it.
If you double-tap the jump button, Mario will get a tiny second jump in the middle of his initial jump.
I've tried fixing it but I'm not 100% sure about the logic around the jump-timer outside of enforcing how long you're allowed to hold the jump-button for upward momentum.
On a side-note, thanks for this lovely repo, it's certainly jump-started my grasp on phaser ๐
Excuse me, the latest version of tiled can't get tile properties
A hint I learned from another game engine: if you add a bit of CSS you can get crisp pixels:
html,
body {
margin: 0;
padding: 0;
image-rendering: optimizeSpeed; /* Older versions of FF */
image-rendering: -moz-crisp-edges; /* FF 6.0+ */
image-rendering: -webkit-optimize-contrast; /* Webkit (non standard naming) */
image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */
image-rendering: crisp-edges; /* Possible future browsers. */
-ms-interpolation-mode: nearest-neighbor; /* IE (non standard naming) */
image-rendering: pixelated; /* Chrome 41 */
}
Hello @nkholski
Thanks for making this template first of all. I would like to ask, i check on the production mode of this template and saw that it's including phaser into bundle, tryed to seperate it to another bundle but i couldn't.
Can you please help me about this or update chuck's with SplitChunksPlugin ? :)
Game works fine, but npm test list 88 problems (88 errors, 0 warnings)
The repository is suffering from not having it's physics adjusted to last Phaser versions' changes in Arcade physics. The live demo now runs better than the version in the repository. I managed to fall through the ground after jumping into the toggle 16-bit block.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.