node-phaser

1.0.1 • Public • Published

node-phaser

Run Phaser on your Node.JS server!

Phaser = require 'node-phaser'
 
game = new Phaser.Game 500500Phaser.HEADLESS
 
game.state.add 'main',
    preload: ->
        @game.time.desiredFps = 10
        @game.updateLogic()
 
    update: ->
        console.log 'frame'
 
game.state.start 'main'

WARNING!

You must call game.state.add and game.state.start instead of new Phaser.Game width, height, Phaser.HEADLESS, { preload: ..., create: ..., update: ...}! If you will not do it, events will not be triggered! Then, you must provide a @game.updateLogic inside preload, or events like create or update will not triggered!

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i node-phaser

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • egorgl