Jump to content

Refactoring from PIXI to Phaser


Recommended Posts



A little background information: I am making a web game engine for turn-based 2D strategy games, open source. It is based on PIXI and I do not have extensive amount of time. Now during years i have been involved with this, phaser has evolved and tools in general have evolved a lot.

I was thinking about the benefits of trying to refactor the project to use phaser, but I am not sure if it’s worth the while. So I will appreciate opinions. I wasn’t really even considering this, until I saw feudal wars really pulling it off. And my project is more lightweight. The actual project is currently here, until it moves to alpha phase: https://github.com/Hachitus/warmapengine the particular code is in src/components/map

At least few actual questions:

  1. Is there a big difference between PIXI and phaser, regarding possible refactor? Now the engine mostly extends containers and sprites and uses the PIXI hit testing manually with pixi interactionManager

  2. What are the plans for the future? Another big reason for refactoring is that web changes really fast and I want to select frameworks that will be developed in the future too. I read also about phaser making it’s own renderer and separating it totally from PIXI. So from that I would also consider phaser more active than PIXI in itself and possibly more stable for the future.

  3. How efficient are phaser event listeners? I have a map with tens of thousands of objects and I handle it through event listener attached to the canvas-element. But could I use the frameworks events as efficiently as making my own event listener for it. Especially when it comes to selecting one single object with click / touch, from that pool of ten thousand objects? The best approach so far has been to use subcontainers, but can something as efficient be done with the native phaser way? So only selecting certain subcontainer based on coordinates and checking inside it for objects and hit testing with those coordinates? And if so, is it trivial or a big operation?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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