Overlapping help please!

artfishartfish Member, PRO Posts: 369
edited May 2012 in Working with GS (Mac)
Hi everybody, this is my first post in the forums. I've been using game salad for about 3 months,and just went pro 3 days ago. I'm working on my 2nd game/1st "masterpiece" lol and I'm having an issue solving my problem.

I've scoured the forums, watched videos from the gurus, but I can't seem to get this right.

The problem.

I have a piano in the game. The bounding boxes for the keys (black and white) overlap. When a key is touched, or tough is inside, it plays the sound. Currently, when I touch a black key, it plays the balck key and the white key next to it(overlapped).(the white boxes do not overlap, just the flats/sharps) Is it possible to have the layer on top,being the black key, be the only touch that is registered? I understand that with overlapping layers, when they are touched, both receive the touch. Can I set it so only the layer in front/top receives the touch?

I would love to here your thoughts and or possible solutions/workarounds.

Much appreciation for any help!

Eric :((

Best Answers

  • OkyshoOkysho Posts: 158
    Accepted Answer
    The problem with GS is that you can't have a collision area that differs from a standard rectangle...

    What you might be able to do is create a boolean value. When your over an overlapping black key, deactivate the white key and activate the black.
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @artfish

    For the white keys, instead of when touch is pressed play noise (or whatever), do:

    When touch is pressed and device.mouse.pos.Y is < (the bottom part of the black key), run sound and the animation you have.

    Let me know how that works,
    Jack McGraw

    P.S. for the next response, if you mention my username (@jckmcgraw), I can respond quicker because I will be notified.

Answers

  • jckmcgrawjckmcgraw Member Posts: 647
    @artfish

    You could have the white keys just be images, and the part not overlapping with the black keys be invisible sensors that trigger the white note. I can't imagine people will be touching between the black keys to hit a white note anyways.

    Hope this helps,
    Jack McGraw
  • artfishartfish Member, PRO Posts: 369
    Jack-Thanks for the quick response!

    They keys also individually move to look like they are being pressed, and I really dont want to give that up bescaue it looks very cool.

    Eric
  • artfishartfish Member, PRO Posts: 369
    Thank you all for the help. We seem to have an intelligent and helpful membership here, you guys rock!. tshirtbooth-extra thanks, your video tutorials have given me a wealth of insight over the last few months- much appreciated everyone!
  • artfishartfish Member, PRO Posts: 369
    Hey @jckmcgraw! That is exactly what I was looking for and a very simple solution. Worked perfectly. Thanks for the insight!
  • jckmcgrawjckmcgraw Member Posts: 647
    @artfish

    Glad I could help :)

    Jack McGraw
Sign In or Register to comment.