jltjltjlt

Members
  • Content Count

    4
  • Joined

  • Last visited

About jltjltjlt

  • Rank
    Newbie

Recent Profile Visitors

499 profile views
  1. Yeah you're right I'm making them in maybe a weird way ? This is how I create them: (this.markers.select is a method I created and added to the markers group) this.markers = this.add.group();for (var i = 0, j = 3; i < j; i++) { var marker = this.markers.create(0, 0, 'marker', this.markers.select, this, 1, 0, 1, 0); marker.anchor.set(.5,.5); marker.inputEnabled = true; marker.input.useHandCursor = true; this.physics.enable(marker, Phaser.Physics.ARCADE);}And I position them later (x and y are calculated beforehand) this.markers.children.forEach(function(s) { s.position.set(x, y);});
  2. Not sure why this happens, but spontaneously, say once every 15 loads, my buttons that are using spritesheets load the whole spritesheet instead of one individual frame (like they're supposed to, like they do most of the time). When it happens they still function normally as buttons, they still trigger their function, but the frames don't change on hover and they remain displaying the whole sheet. Attached a screenshot of three buttons in the state I'm talking about. They are supposed to be just the red rings, but the yellow frame is showing. Any ideas? Ever seen this happen before? I looked around but didn't find anyone else with this problem.
  3. Thanks for your answers everyone. @drhayes, there doesn't seem to be any significant performance problem though I haven't checked my script on a slower computer yet. I was just hoping to learn a way to leverage the Phaser code to accomplish the same thing. Upon inspection though, the Phaser specific callAll() and checkAll() (and others) are just for loops themselves. Phaser.Group.forEach as @chongdashu suggested, with a predefined function, will probably be my route. @zatch thanks for the detailed response! My particles are very simple, but I'll definitely be using that technique on something in the near future, very handy.
  4. I'm looking to check the x value of all children of an emitter and kill it if x > 200. Here's my immediate non-phaser method solution (this is in the update loop) for (var i = 0, j = windEmitter.children.length; i < j; i++) { var s = windEmitter.children[i]; if (s.x > 200) { s.kill(); }}Seems like there's got to be a more efficient way to use a Phaser.Group method ( like checkAll() or callAll() ) but I can't figure out how to format them and still include my conditional. Thoughts?