I need help with picking instances of the same sprite.

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have multiple instances of the same sprite on the screen. They have their own instance variables. When an instance variable changes to number that I like, I want to do stuff to those sprites that now have their instance variables changed. How the heck do I pick them in a condition?

    I have attached an image where I have been trying to understand what is happening. at the top, it seems to work fine, every Xseconds, choose all images, and for each image find that own image number/location/etc and do math. Each instance has its own numbers of its own position/etc.

    Next, Pick a instance who's value is greater/lesser than its own old one. And then do stuff to that particular instance such as change its value.

    Last, at the bottom, I have a variation that I thought would work by getting all instances that have such greater/lesser value. then for each of those, set the switch to on. I tested these with each disabled and whatnot.

    And that is where I am lost, because the condition is still picking (i think) the first image that has this correct value and then applying the action to all the instances on the screen. Thanks for your time!

  • You don't need Pick all, For Each and Pick by comparison in this case. You can change your events like this:

    If it still doesn't work as it supposed to, try changing it to "Every 2 seconds", leave just one instance of the AnEnJetBot and run your project in Debug Mode. Hit pause, inspect all instance variables, resume, pause again after 2 seconds, check variables again.

    Once you fix it for one instance, you can try with multiple instances.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you. I also realized I used the wrong instance name to change the variable on.

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