How do I compare two sprites to see if they are the same

0 favourites
  • 5 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hi all, can anyone tell me- I am making a little game where I have a random sprites appearing on the screen.

    At the bottom of the screen I have another sprite that you will press if the sprites are the same as each other.

    It's probably simple but late last night just couldn't work it out.

    Cheers.

    Matthew

  • Put them in a Family, add a Family instance variable ID, and for each Sprite type have a different ID (1, 2, etc), and check the pressed one's ID is the same as the displayed one. I think that will work.

    [attachment=1:2xnxe8zr][/attachment:2xnxe8zr]

    edit: after doing this I thought you might just use the Nickname plugin..

    2 families, a little more setup (2 lines per object) but scales better

    [attachment=0:2xnxe8zr][/attachment:2xnxe8zr]

  • HI thanks, I am at work at the moment but when i get home later I will give it a try.

    I will let you know how i get on.

    Cheers.

    Matthew

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • HI again, just had a look at both of your examples. They are both very useful and have made it much more clear for me to achieve what I am trying to do. The second cap.x is what I was trying to do. To try to understand it all I have written it all out again in my project rather than just using yours and changing sprites etc.

    Thank you.

  • No problem, if it helped in any way that's cool. I probably could've commented it more

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