Piano

YummyYummy Member Posts: 51
edited November -1 in Working with GS (Mac)
i am trying to create a piano app with gamesalad, but seem to be stuck

i have set all the code to play sounds but when i click a black key it plays the white and black key

any help?

thanks much appreciated

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You'll have to come up with a way to determine if the touch is up in the black key area or white key ares so it knows not to play the white Key also. theres a couple ways you could do it. one would be have invisible actors that are only over the lower part of the white keys with all of your touch rules. if you are animating the keys though it will require you adding attributes so the actual key image will know when the invisible actor over it is being pressed.

    you could also add to your white keys touch rule a condition that the y position of the touch is lower that the lowest point of you black keys before it registers as a white key touch.
    That be an issue though if you are allowing more than one key to be pressed at a time you will have to setup a bunch of rules for each touch.

    Those are just a couple ideas though there are several ways you could go about achieving what you want. the fun is finding a new way to do it. :)

    ___________________________________________________________________________________
    Project Help from Tenrdrmer Click Here

    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    Expanding Option Menu Template HERE!!
    Tenrdrmer's Menu # 3 HERE!!
    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • xyloFUNxyloFUN Member Posts: 1,593
    Hey yummy,
    The best way to do this is to use two actors because by doing so, you can create an L shape and that is all you need.
    If you need additional info, feel fee to fire away :-)

    Have fun ...
  • YummyYummy Member Posts: 51
    Hii but i put it as when touch pressed change image so it gives indication
  • mangaroomangaroo Member Posts: 419
    That can still be done with two invisible actors to make the L that when triggered change a global attribute

    when that global attribute is changed = white colour key is animated
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yep like mangaroo said u just need a attribute for each key, that each piece of the key will be tied to.

    So you ahve a attribute called white1 (ill use that as exampole to reperesnt the first key)

    have a rule when touch is pressed change white 1 to 1, otherwise change white 1 to 0.
    You put that in both of the actors makin up the one key.

    Then have another rule in both actors when attribute white1=1 play sound and change image to the key pressed image, then in the otherwise section change image to the image of the key up

    cheers
  • YummyYummy Member Posts: 51
    Thanks guys

    Much appreciatedddd
Sign In or Register to comment.