Leftium Posted August 24, 2017 Share Posted August 24, 2017 I would like to store properties for my game objects outside Phaser, instead passing these properties (x, y, rotation, texture, etc...) for Phaser to render. Is it possible to expose a render function like this, or is rendering too tightly coupled to game objects? The alternative is to manually sync Phaser's game objects with my (Mori or Immutable.js) game state. My reason for doing this is so I can store my game state in an immutable object. Separating game state from Phaser allows seamless hot code reload. By keeping a historical list of these immutable game states time travel with trails is possible. (See the video below) Link to comment Share on other sites More sharing options...
rich Posted August 29, 2017 Share Posted August 29, 2017 All of the rendering code for each Game Object is split out into its own function. By inspecting that you can figure out precisely the information needed to be passed into the renderer and construct your own Game Objects. Rybar 1 Link to comment Share on other sites More sharing options...
Recommended Posts