System picking question.

0 favourites
  • 5 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.
  • Hello again! I just have a simple question that I can't figure out on my own. What would be the proper way to select different instances of the same sprite? I start out with the original one on my board for the match 3 game I'm making, but I made it so that every time I left click another instance spawns. I want to control these individually. Any help would be greatly appreciated!!! Thanks!<img src="smileys/smiley1.gif" border="0" align="middle" />

  • Each object that gets created gets assigned a "UID" eg: sprite.UID

    this number is unique to each object running in the game, so you can check against that to pick a specific instance.

    Using, pick by evaluate, or pick by comparison events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • justifun Thanks for replying justifun! Would pick by evaluate or comparison work for large amounts of the same sprite, and possibly unexpected outcomes? Like say the person playing loses within just the first few minutes and no more sprites need to be spawned, or the opposite they survive a very long time and hundreds of the same sprite need to be spawned. Please let me know, and thanks again!

  • Here's some more info

    scirra.com/manual/130/common-features

    So yes, to answer your question, you should not run into any issues.

    Each time a new instance is created it gets assigned a number (UID).

    Then depending on when you want to isolate that particular instance eg:

    Mouse on object click "enemy"

    ->pick by evaulate enemy.UID = 57 -> enemy Destroy

  • justifun Thanks for the info justifun! I'll let you know how it goes. Have a great night. <img src="smileys/smiley1.gif" border="0" align="middle" />

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