Jump to content

Search the Community

Showing results for tags 'foreachalive'.

  • 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. Hello. I'm trying to destroy some sprites that belong to a group by looping using the forEachAlive method. Has anyone encountered a this.children is undefined error when trying to destroy a sprite that belongs to a group? Using box.kill() doesn't generate the error, but I thought destroy is better if you're not going to use the sprite anymore because it frees up resources. If I thought wrong, feel free to correct my understanding of destroy vs kill. Thanks! document.getElementById("textinator").onkeydown = function(pressed) { textinator = this; typedAnswer = this.value; correct = false; if (pressed.keyCode == 13) { boxes.forEachAlive(function(box) { if (box.answer == typedAnswer) { correct = true; box.destroy(); //box.kill(); } }); } if (correct) { textinator.value = ""; } else { }}
×
×
  • Create New...