Brad P. Taylor

  • Content Count

  • Joined

  • Last visited

Posts posted by Brad P. Taylor

  1. I agree with @ZoomBox having the rocks collide with the platforms would be nice. But please keep some sort of unexpected death from above that is not affected by the platforms to keep players from just sitting and hiding under platforms :)

  2. Hello Everyone,


    I was in need of some temporary art for a project and it dawned on me hey Flickr's API has the ability to search on tags and licenses... lightbulb moment - hey wouldn't it be great if I could just ask Flickr for an image with a set of tags and get sprite back (or a list of related images :)


    you can find the gist here



    oh yeah you need to have a flickr api key and there are limits to the number of images you can pull down an hour, so it probably makes sense to implement some sort of local caching system. (or you could just copy them from your browser cache like I did after getting them...)




  3. @PadreMontoya I have a partial solution, I'm still working out the kinks on transforms and clipping masks.  Anyway what I did was create a invisible sprite which has a drag handler and a hitarea the size of the clipped scrolling area that forwards movement/timing info to the zinga scroller really any scroller would work but theirs was simple to integrate.


    The drag helper sprite and calls into the zynga scroller is in this gist, the full code relies on a couple other files so it isn't a finished solution for you but might help some.





  4. Hello Everyone,


    This is a question, possible answer and a feature request all rolled into one.


    First the question:


    For my UI I need a way to set a specific sprite (or set of sprites) to be the only ones with active inputHandlers, Basically setCapture/releaseCapture... I spent a fair amount of time looking over the input system and didn't see this feature? 


    My 'answer'



    This code adds setCapture, releaseCapture and getCapture to the Phaser.Input class.


    setCapture takes a single inputHandler or an array of them and will push the currently active notion of interactiveItems making the arguments the current set of interactive elements. The releaseCapture method restores things to the state before the push and of course getCapture returns the inputHandlers that have captured input.


    The feature request


    My hack works enough for now, but it seems clunky and woe to me if I ever need enable/disable sprite inputs while inside a capture mode. A more robust event bubbling system for sprites (and groups), would be really handy.  I know this isn't a trivial request but it would probably make things easier for making certain types of UI.







  5. Hi All,


    While working on the ui for my project I needed to disable input for sprites that were clipped to a smaller scrolling view (think scrolling list), I peeked around the Input and InputHandler code and didn't see an way to restrict the input for the child from a parent (or grandparent)?  Anyway I cobbled together a way to clip input for decedents. The code can be found in a small gist here



    It's pretty simple it modifies the prototype for InputHandler, by adding an ancestor search after any truthy result returned by the original checkPointerDown or CheckPointerOver. This allows any ancestor to define a property (defaults to 'input_clipping_rect') which will can be used to reject false positives (ie things outside the smaller view but inside the child). 


    Here is the code too just in case the gist isn't available. 


    (function(property) {


        var local = new Phaser.Point();

        function askAncestors( child, pointer ) {

            for ( var parent = child.parent; parent; parent = parent.parent ) {

                var clip = parent[property];

                if ( !clip ) continue;

       parent, pointer, local);

                var cx = local.x - clip.x, cy = local.y - clip.y;

                return (0 <= cx) && (cx < clip.width) && (0 <= cy) && (cy < clip.height);


            return true;



        var _checkPointerDown_ = Phaser.InputHandler.prototype.checkPointerDown;

        Phaser.InputHandler.prototype.checkPointerDown = function(pointer, fastTest) {

            if ( ! this, pointer, fastTest ) ) return false;

            return askAncestors( this.sprite, pointer );



        var _checkPointerOver_ = Phaser.InputHandler.prototype.checkPointerOver;

        Phaser.InputHandler.prototype.checkPointerOver = function(pointer, fastTest) {

            if ( ! this, pointer, fastTest ) ) return false;

            return askAncestors( this.sprite, pointer );



    })( 'input_clipping_rect' );

  6. Enigma Virtual Box, might be what you are looking for I haven't used this for a shipping product (yet) nor have I tried it with node-webkit.exe, however my experiments with it for bundling dll's and files into a single .exe works surprisingly well.  Their $$$ products are also very interesting sounding as well however online publishers usually have their own wrappers but for selling something yourself it might be good?


    oops almost forgot the url ( )

  7. Hello Anybody,


    I just encountered a problem when preloading json, with IE9.  I tracked the problem down the Phaser.Loader.jsonLoadComplete handler is using this._xhr.responseText instead of this._ajax.responseText when window.XDomainRequest is used.  I checked the master/dev and parallel-loader branches there doesn't seem to be fix in place yet, is this a bug or am I missing something else here?  




  8. 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