How do I pick objects related to other objects?

0 favourites
  • 2 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • (moved this from the general discussion forum)

    I have an enemy object type and an enemyBox object type. Each enemy object has an associated enemyBox object, and they both have a uniqueID instance variable that ties them together. In other words, an enemy and an enemyBox are related if enemy.uniqueID = enemyBox.uniqueID.

    Here's what I'm trying to do. I start off with a subset of enemyBoxes, for example: pick all enemies on a given platform. From that subset, I want to pick all of their related enemyBoxes. In other words, pick all enemyBoxes that have a uniqueID matching a uniqueID from the previously picked enemies.

    How would I code that in C3? It's the bold part that's throwing me off.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok I think I figured this out:

    pick enemies

    for each enemy

    pick enemyBox by comparison (enemyBox.uniqueID = enemy.uniqueID)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)