Jump to content

Search the Community

Showing results for tags 'getChildIndex'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. I've been working on a prototype for the last few weeks using Phaser v2.2.2 with moderate success. Earlier this week I decided it was probably time to update Phaser to keep current. Everything went relatively smoothly except for this one issue I've been dealing with since. Before posting here, I did as much research as I could to see if any breaking changes had come with this new version regarding groups and sprites. I didn't see anything in the release notes, nor did I see any changes in the code when I looked. So I'm hoping someone with more insight could help me out here. In a loop, I'm adding invisible sprites to a group, with coordinates surrounding another sprite: var sprite = this._tile_collisions.create(position.x, position.y);sprite.valid = true;sprite.height = 50;sprite.width = 50;sprite.inputEnabled = true;sprite.events.onInputDown.add(this._canMoveToTile, this);this._game.physics.arcade.enable(sprite);this._tile_collisions.add(sprite);And then in an update method I'm checking for overlap with another group: this._game.physics.arcade.overlap( collisions, this._tile_collisions, function (collider, tile) { // I cannot get the index of this child var index = this._tile_collisions.getChildIndex(tile); }, null, this);I should probably mention that the onInputDown event on the sprite removes the children from the group (using removeChildren()), tweens the player sprite to a new position, and then adds new sprites to the group. When create() is called for the first time, things run fine. However, after that sprite movement everything falls apart. Error: The supplied DisplayObject must be a child of the callerThis used to work beautifully until I upgraded. So my question is: has something changed that I'm not aware of that should alter the way I'm writing this? If so, how can I get this overlap to work?Any help is greatly appreciated, and if I need to give more details just let me know.
×
×
  • Create New...