All Projects → f → phaser-coffee-boilerplate

f / phaser-coffee-boilerplate

Licence: other
Phaser CoffeeScript + Browserify + LiveReload Boilerplate

Programming Languages

coffeescript
4710 projects
CSS
56736 projects

Phaser CoffeeScript + Browserify + LiveReload Development Boilerplate

It's a very simple boilerplate for Phaser framework, including the example of @demircancelebi's Together game.

Installation

To start using Phaser with CoffeeScript easily,

git clone https://github.com/f/phaser-coffee-boilerplate my-game
cd my-game
npm start

main.coffee

main.coffee is your main file. You should write your game's HTML presentational parts here. Since this boilerplate uses browserify you can/should use require function of Node.js easily. TL,DR; it's main file.

config.coffee

This is a simple JSON exporting JS file. So you can put some logic if you need.

state.coffee

This is the main logic of your game. Everything happens here.

config = require './config.coffee'

class State

  constructor: (game)->

  preload: ->
    # Preload Stage
    @game.stage = $.extend @game.stage, config.stage

    # Preload all images from config file
    @game.load.image imageName, path for imageName, path of config.images

  create: ->

    # Create world.

  update: ->

    # Living world.

module.exports = State

Have fun! :)

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].