Gamesalad seems to want to press two 'buttons' at once!
seble
Member Posts: 4
Hi all. First time posting here.
As part of an app I am working on, there is a keyboard involved. Now I've put the sounds in for the black keys today and there appears to be a problem. The Black keys as you know sit on top of the white keys of the piano - but for some reason whenever I press a black key on gamesalad it seems to want to play a white key too! I've included a video to reference as it might be quite difficult to explain what I mean otherwise.
Can anyone help?
As part of an app I am working on, there is a keyboard involved. Now I've put the sounds in for the black keys today and there appears to be a problem. The Black keys as you know sit on top of the white keys of the piano - but for some reason whenever I press a black key on gamesalad it seems to want to play a white key too! I've included a video to reference as it might be quite difficult to explain what I mean otherwise.
Can anyone help?
Comments
So my suggestion would be to have your images down underneath, but don't have the white keys with the Pressed rule. Instead put that rule inside an invisible actor that you put over the white keys, BUT it can only extend up near the black key. If it overlaps on the black key you will just have the same problem. So how you could lay this out would be something like...
If you have a boolean for each white key determining if it is pressed or not, you would have the invisible actor sitting over the white key On Touch Press change the boolean. Then you simply have the keyboard images respond to the boolean as though it was touched in your video above.
I hope that makes sense.
Thanks, that makes sense. I can't believe it's taken me almost a year to get back to you. Having fallen ill and then being student means I'm only just resuming this project now! I completely get what you're saying, however when I go to create a rule for this particular invisible image laying over the 'key' it won't allow me to change the image of the other key so it doesn't look like it's being 'pressed' or am I missing something here?
In the Spare Code thread someone - @RThurman if I remember correctly - posted a method for only having the top actor register a touch. It should solve your problem. Sorry I can't direct you to the specific post
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks, I will have a look now for this!
@seble -- I think @FallacyStudios meant something like the attached demo.
I think he'd be better off (though six of one, half of dozen of the other) with your layers demo.
I don't remember what you called it (if it was you) but it was the method
Change Attribute game.Layer to game.Layer+1
Change Attribute self.Layer to game.Layer+1
If self.Layer > game.Layer then
etc. etc.
I use it regularly now and it's extremely handy.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
This was exactly what I needed to solve the problem, I hope employing it this way won't cause problems later down the line when things get a bit more complex, but thanks so much everyone, you've really helped me, and the demo helped me understand exactly what i was doing wrong with the attributes. Note to self, attributes are case sensitive!
Hi @seble Good advice from @Armelline & @RThurman there is yet another solution to your problem - though this is on the assumption that the player of the keys don't usually use/press the thin bits of white directly next to the black keys...
But I don't think most people do anyhow... so simply add invisible actors over the areas of white at the bottom of each white key, just under the black keys, and transfer the rules from the white key actors to these transparent overlay ones.
Here is showing the area I'm talking about on one of the white keys:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps