Problem with two actors that overlap

akimannakimann Member Posts: 62
edited November -1 in Working with GS (Mac)
First, please excuse my bad english:-)
I have a the following problem:

I do have two actors that overlapp. Each actor should change his image when I click on it.
When I click on the actor which is in front but in the area where the two actors overlap, the actor behind it
also change his image (but he shouldn´t do that).

For example: Imagine a pianokeyboard: the "black-key-actors" overlapp the white keys. When I press the black key it should change his image to a "downpressed" key. But because the black keys overlapp the white once, the white key show also his "pressed down image" also the isn´t touch during gameplay.
How can I solve this problem...

Hope you can help me an greatings from Germany!

Alex

Comments

  • calvin9403calvin9403 Member Posts: 3,186
    make an attribute for that
  • akimannakimann Member Posts: 62
    sorry for beeing a newbie but, I have no idea how I could solve this problem with attributes...*shame*
  • simo103simo103 Member, PRO Posts: 1,331
    Hi akimann .. when you open Gamesalad click the NEW+ and search for Top Card. Double click the result and it will open a template that you have full access to.

    In that template should be the code you will need to solve your issue. Sorry I didn't create the template so I'm not familiar with how it works.

    Greetings from Canada!
  • calvin9403calvin9403 Member Posts: 3,186
    akimann said:
    First, please excuse my bad english:-)
    I have a the following problem:

    I do have two actors that overlapp. Each actor should change his image when I click on it.
    When I click on the actor which is in front but in the area where the two actors overlap, the actor behind it
    also change his image (but he shouldn´t do that).

    For example: Imagine a pianokeyboard: the "black-key-actors" overlapp the white keys. When I press the black key it should change his image to a "downpressed" key. But because the black keys overlapp the white once, the white key show also his "pressed down image" also the isn´t touch during gameplay.
    How can I solve this problem...

    Hope you can help me an greatings from Germany!

    Alex

    make a game attribute call change (a boolean)
    set it to false
    when touch is press AND attribute change is false then change image to ...and change attribute change to true( set this in the white key board)
    when touch is press AND attribute change is true then change image to...and change attribute change to false( set this in the black key board)
  • akimannakimann Member Posts: 62
    @calvin and simo:

    Thank you very much for your help. That solved my problem and makes me smile:-)

    Alex
  • calvin9403calvin9403 Member Posts: 3,186
    akimann said:
    @calvin and simo:

    Thank you very much for your help. That solved my problem and makes me smile:-)

    Alex

    glad to help
Sign In or Register to comment.