Jump to content

Phaser Prefab and scene .json discussion


Brad P. Taylor
 Share

Recommended Posts

Hello everyone, 

 

I just recently started using Phaser and I am very impressed with it (and PIXI.js too) amazing work everyone! I started rolling my own Prefab style factory which naturally lead me to thinking about automatically nesting prefabs and in general creating layouts and scenes in json files etc.  What started out as a couple dozen lines rapidly exploded into a few hundred... Then I saw that a new version of Phaser was released so naturally I upgraded to 2.0.6 and breezed over the what's new and bingo an asset pack loading system spontaneously appears and the mention of scene creation. Is there an open discussion of this topic already of what's planned or a general listing of existing scene/prefab systems for Phaser/PIXI?  

 

My code is early and very rough around the edges having been more or less a stream of hey I should add this, that and this lamp (joke), however it already has a few things that I have found useful and have relied on in the past with other engines and I thought I would share what I have so far and embarrass myself publicly :)

 

So far my pile of code does the following things that I find useful.

 

1. Easy way to associate a class with a name and .json file.

2. Simple layouts, nested groups.

3. The ability to reference other .json files to pull common settings from. (sort of inheritance for but data, very rudimentary)

4. Reasonably simple randomness, logging and auditing of data.

 

Anyway if you are interested in discussing or seeing some code have a peek at https://gist.github.com/lardratboy/aa0f25e6741929b1b33f

 
Regards,
Brad

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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