Jump to content

Custom Phaser Builds


Recommended Posts



I am completely new to Phaser.


My first step was to create a custom build of Phaser by following the information at:



My custom build was created by the following:


grunt custom --exclude gamepad,intro,retrofont,ninja,creature,tilemaps,outro,rope,tilesprite,tilemaps --sourcemap true --uglify true


However i get an exception in the custom phaser.js file at:


Phaser.TileSprite.prototype = Object.create(PIXI.TilingSprite.prototype);

Phaser.TileSprite.prototype.constructor = Phaser.TileSprite;


If i take out the tilemaps stuff:


grunt custom --exclude gamepad,intro,retrofont,ninja,creature,tilemaps,outro,rope --sourcemap true --uglify true


I get an exception:


Phaser.Rope.prototype = Object.create(PIXI.Rope.prototype);

Phaser.Rope.prototype.constructor = Phaser.Rope;


If i take the rope stuff out I get an exception at:


PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];


(JavaScript runtime error: Unable to get property 'NORMAL' of undefined or null reference)


What am I doing something wrong? I does say on the Phaser webpage that the build script will warn you if you cannot exclude a module because of a coupling with another required module. But I see no warnings.


Running the full build of phaser works fine.


Thanks for any help!


Link to comment
Share on other sites



From a quick look it seems as though the --exclude flag stops the excluded modules being put in the modules folder during the grunt task, but the gameobjects.js file when setting up the inheritance chain for certain objects tries to instantiate excluded PIXI objects:


Phaser.Rope.prototype = Object.create(PIXI.Rope.prototype); 


In this case PIXI.Rope does not exist.


Somebody else must have experienced this or do most people just use the full monty build?


Cheers for any help.

Link to comment
Share on other sites

  • 4 weeks later...

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...