https://github.com/f/phaser-coffee-boilerplate
Phaser CoffeeScript + Browserify + LiveReload Boilerplate
https://github.com/f/phaser-coffee-boilerplate
Last synced: over 1 year ago
JSON representation
Phaser CoffeeScript + Browserify + LiveReload Boilerplate
- Host: GitHub
- URL: https://github.com/f/phaser-coffee-boilerplate
- Owner: f
- Created: 2014-06-12T12:21:07.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-11T06:58:25.000Z (over 11 years ago)
- Last Synced: 2025-03-18T20:16:23.932Z (over 1 year ago)
- Language: CoffeeScript
- Size: 171 KB
- Stars: 27
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phaser CoffeeScript + Browserify + LiveReload Development Boilerplate
It's a very simple boilerplate for Phaser framework, including the example of [@demircancelebi][1]'s Together game.
## Installation
To start using Phaser with CoffeeScript easily,
```bash
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.
```coffeescript
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! :)
[1]: https://github.com/demircancelebi
# License
MIT.