Sign in to follow this  
Brad P. Taylor

Phaser Prefab and scene .json discussion

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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.