Instance variables for each sprite

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi,

    I have a puzzle pieces that are duplicated. I want that each of the pieces have their own attributes, I define some instances variables for the sprites, but all the pieces have the same values and if I change to one of them all are changed. I read about the instances variables belong to each object.

    Maybe I can use one sprite for each piece but I don't know how affect it to performance.

    What I'm doing wrong?

    Salut,

    Josep M

    [attachment=0:degnl77i][/attachment:degnl77i]

    [attachment=1:degnl77i][/attachment:degnl77i]

  • You aren't picking the specific instance. I'm assuming event 4 is the problem. You are saying on ANY Right click, subtract one from ALL Sprite2 objects. By default, all of an object are picked. If you made the mouse check the Sprite2, like you did with event 2, it should work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The event 4 is for simulate that the piece lost RES (resistance) but when I left-click on any of the others pieces always show the same RES value, no matter what right-click, even the same value.

    I want simulate that each of the pieces have one start values, and then as the game run with the user interaction the pieces lost RES.

    Salut,

    Josep

  • What Blackhornet was saying is change event 4 to

    on right button click on sprite2 -- sprite2 subtract 1 from Res

    the way you have it now it does not know which sprite you want to (subtract 1 from res) from so it is doing it to all sprite2s

    by using "on right button click on sprite2" it will only pick the sprite2 that your mouse in on while right clicking

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