0 Favourites

Can I specify different instance variables?

  • I am creating a study game in which different parts of an image are labeled. So far, my best guess as how to indicate the parts of the labels is with a sprite at each point. My plan was to give each sprite a different value for an instance variable and use these numbers in matching - at least this was my plan before I realized that changing the initial instance variable for one sprite changed it for all instances.

    Is it possible to set different values? Do you know of a better solution?

    (It is not possible to create multiple collision polygons for one sprite, correct?)

    Thank you!

  • That's not quite right, changing an instance variable does not automatically affect all instances. It only affects instances that matched the event's conditions. To only affect certain instances, make sure your conditions only apply to the instances you want to affect. More information in How events work.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanks for the reply. I wasn't quite clear with my question. What I want to do is be able to assign a different, specific number in each instance based on where it is in the layout. The sprites are positioned at specific points relative to a background image, and I want to be able to identify the sprite that is at that specific point. The number assigned to a specific sprite should not change in any events.   Am I going about this completely the wrong way? (Do you understand what I'm trying to accomplish and have an alternative to suggest?)

    Thanks again.

  • Never mind! I think I have this working.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[Plugin] instance bank2
85 18,380
rexrainbow's avatar
rexrainbow
Unread hot topic
64 12,950
trollface's avatar
trollface
Unread hot topic
0 Favourites
[PLUGIN] Instance Group
50 17,113
sagispin's avatar
sagispin