Coder Social home page Coder Social logo

pafeltowicz / boilerplate-phaser-es2016 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from piecioshka/boilerplate-phaser-game

0.0 1.0 0.0 11 KB

:fork_and_knife: Example game based on Phaser.js. Use ECMAScript 2016 syntax.

JavaScript 89.33% CSS 0.48% HTML 10.19%

boilerplate-phaser-es2016's Introduction

boilerplate-phaser-es2016

๐Ÿด Example game based on Phaser.js. Use ECMAScript 2016 syntax.

Features โœ”

  • 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!

Steps to launch the project

$ npm install       # install dependencies
$ npm run build     # build distribution files in public/dist/

Development

$ npm run typings   # support syntax highlighters
$ npm run watch     # run Webpack to listen of file modifications

Misc

$ npm run clear     # remove all generated files
$ npm run count     # count LOC (line of code)

Troubleshooting

Uncaught TypeError: Cannot read property 'cache' of undefined

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

License

The MIT License @ 2016

boilerplate-phaser-es2016's People

Contributors

piecioshka avatar maxprafferty avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.