rich

Administrators
  • Content Count

    6,394
  • Joined

  • Last visited

  • Days Won

    294

rich last won the day on September 14

rich had the most liked content!

About rich

  • Rank
    Administrator
  • Birthday 08/12/1975

Contact Methods

  • Website URL
    http://www.photonstorm.com
  • Twitter
    photonstorm
  • Skype
    richard.davey

Profile Information

  • Gender
    Male
  • Location
    UK

Recent Profile Visitors

12,312 profile views
  1. Groups in v3 don't work the same as in v2, they're not containers. If you call Group.setDepth it will (as the docs say) immediately set the depth value of each child. If it has no children, or a child is added after you call this (like in the code above), it won't make any difference.
  2. It's not just about memory, there's a tangible cost to the set-up and creation of animation data if done at run-time too, especially if every Sprite is carrying its own baggage around with it. You want expensive operations, like creating a bunch of animations, to be done once at the start when your game is loading, and then in-game when a Sprite is assigned an animation for it to be virtually instant. By all means, track performance and be as OCD as you like, but to then talk about even thinking of using setInterval in the same thread is like the complete polar opposite
  3. To clarify what I said you have to think about this the other way around. Yes, you may have to create 100 unique animations in the global Animation Manager, but this is absolutely nothing in terms of memory compared to how v2 did it. Say you have several thousand Sprites in your game, maybe even tens or hundreds of thousands over the *lifetime* of playing your game. In v2 that would literally be thousands upon thousands of identical animation data, one unique copy for every single instance of any animated sprite in your entire game. Back to v3, yes you may have a hundred global animations, that may or may not use the same frame indexes as each other, but it’s still a fraction of the memory required compared to every Sprite carrying its own data around with it (which is what you’ll end up with if you follow your approach above). Because it doesn’t matter how many Sprites your game creates, the quantity of animations never changes. Don’t optimise the wrong place, because unless every single sprite in your game uses a 100% unique animation, any other approach will consume more memory in the long run.
  4. You can't, which is specifically why it says in the docs you can't do it.
  5. rich

    Glitchy Phaser examples

    Which version of Phaser have you put with them? It says in the console when run.
  6. rich

    Get MatterJS collision point and normal

    This is something you should request on the matter repo. If they add it upstream, I can expose it downstream.
  7. rich

    Get MatterJS collision point and normal

    The 'event' passed to your callback is all of the Matter collision event data, untouched. Anything you can get via Matter normally, you can get from that event.
  8. Remove it and then destroy it. The destroy docs are out-dated. In 3.15 remove calls destroy automatically.
  9. rich

    How to reuse game.anims animations?

    If you're at the point where 12 tiny 4 frame Animation objects are a performance consideration, I'd say you've much more serious things to worry about. Especially considering the alternative, which is that you have 1 single Animation object, but every single call to 'play' now has to check for a frame offset value, and the value needs to be stored and applied every single time the frame of the animation changes, multiplied by the number of Game Objects using animations.
  10. rich

    3.14 Tilemaps white spaces / culling

    Try expanding the culling area of the map layer (setCullPadding method)
  11. There's nothing to find, this isn't the result of an API change. It's just another bug with the less than stellar light map code, which honestly ought to be removed entirely.
  12. rich

    Enabling SSL via localhost

    It works in Firefox too, but you're right, it doesn't work in Chrome. I always have to use FF when testing FBIG games locally.
  13. rich

    Add Physics editor vertices to scene with no sprite

    Use this: /** * [description] * * @method Phaser.Physics.Matter.Factory#fromVertices * @since 3.0.0 * * @param {number} x - [description] * @param {number} y - [description] * @param {array} vertexSets - [description] * @param {object} options - [description] * @param {boolean} flagInternal - [description] * @param {boolean} removeCollinear - [description] * @param {number} minimumArea - [description] * * @return {MatterJS.Body} A Matter JS Body. */ fromVertices: function (x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { var body = Bodies.fromVertices(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea); this.world.add(body); return body; }, You can access it via `this.matter.add.fromVertices` in any Scene.
  14. http://labs.phaser.io/index.html?dir=physics/arcade/&q= Look at the 'larger bounding box' and 'smaller bounding box' examples.
  15. You talking about for input detection or physics?