Jump to content


  • Content Count

  • Joined

  • Last visited

  1. tres bien!~ it did help, thanks @Horizonicblue. bats.forEachAlive(function(bat){}) was the missing link. i'm often confused when using the () to grab specific sprites in a group, but this pointed me in the right direction.
  2. thanks so much for the reply. could i trouble you for an example? i checked for one on the phaser website but couldn't find one for the desired effect.
  3. anyone? the basic question i guess is how do you assign unique functions to individual sprites in a group of 6 without having to assign variables to all 6. for instance, if you made the sprites like this: for (i = 0; i < 6; i++) {bat.create(Math.random() * 600 + 300, Math.random() * 600 + 300, 'bat') bat.callAll('animations.add', 'animations', '1', [0, 1], 6, true); bat.callAll('play', null, '1')} the top line creates 6 randomly placed "bats" in a perimeter while the bottom one adds and plays animations for all. i'm looking for an effect like the bottom line, except one that detects
  4. suppose you have two different lines: game.physics.arcade.overlap(pl, bat, function(sp, sp2) {sp2.kill()}) and if (game.physics.arcade.distanceBetween(pl, bat) < 222) {bat.kill()} the top detects when the player touches a randomly placed bat in a group and kills it, the second detects when the player is in RANGE of a randomly placed bat in a group and kills it. the problem is the second one doesn't work. i'm essentially looking for a way to merge these two so that the bat in line 2 dies the way the one in line 1 does. this doesn't seem to work either: if (game.physics
  • Create New...