🍴 Example game based on Phaser.js. Use ECMAScript 2016 syntax.
- Phaser v2.6.2
- Webpack v2.2.1
- Babel (ECMAScript 2015 + ECMAScript 2016 + Stage 0 of ECMAScript 2017)
- super-event-emitter v4.1.4 as event management
- Typings (Phaser, super-event-emitter) for syntax highlighters
- Task to count line of code (LOC)
- Simple structure for app:
constants/
,models/
,states/
- Example map (build in Tiled)
- Static directory:
public/
- Maximum 80 characters per line in each file!
$ npm install # install dependencies
$ npm run build # build distribution files in public/dist/
$ npm run typings # support syntax highlighters
$ npm run watch # run Webpack to listen of file modifications
$ npm run clear # remove all generated files
$ npm run count # count LOC (line of code)
Player sprite does not have reference to main game object.
new Player(); // ERROR
new Player(this.game); // OK
Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'
List of used tileset in map should be defined after map setup.
this.map = this.add.tilemap('example-map');
this.map.addTilesetImage('street'); // MUST BE ADDED
The MIT License @ 2016