Actions possible depending on image shown
Appulocity
Member, PRO Posts: 46
Hey everyone, Im having trouble with making certain actions only possible when another actor is using a specific image. Concept is 6 different colours and you can only touch the coloured object when the same image is displayed. Similar idea to Simon says. If you touch any other colour other than the one shown then the game should reset but Ive found at the moment it simply doesn't work for me. Any help would be greatly appreciated. (first GS game)
Comments
Are those 6 colors randomly changed?
My Gamesalad Games On App Store:
Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1
Yes they are
So at any one time, all 6 objects are spawning randomly but you can only touch 1 of the 5, that one changing randomly
Try this:
Create a global integer attribute, let's say Color and have your main actor (the simon says actor) carry the timer every X seconds change Color attribute to random 1-5. For each number 1-5, create a color for it, and change your main actor color accordingly.
Now create a second actor and an integer attribute (name Self Code or something like that) only for this actor. Drag and make 5 copy of the second actor and change it Self Code for each of them 1-5.
On the second actor, create rule, when touch is pressed And Self Code = global Color code then Destroy actor.
Let me know if you need further help. I might create a demo file for you if I have time.
My Gamesalad Games On App Store:
Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1
Thanks I will give it a try. Thanks for your help
Still having trouble, doesnt want to recognise the changing image attribute.
What Ive got so far is:
Every random(2,8) change attribute: self.image to "image"..random(1,6)..".png"
That works but then to recognise the global change ive got:
when attribute self.image is "image1.png"
change attribute game.image1 to true
otherwise change attribute game.image1 to false.
Im then using that to determine which colour is okay to touch with on each different coloured actor:
When both actor receives event touch is pressed and attribute game.image1 is false destroy actor.
Problem is it doesnt matter if it is showing the right colour or not it still destroys it when touched. Not sure what to change.
Hi @Zenithax so it's like Simon Says but still different, is that right?
Something like
You've just the one large image which changes colour randomly every 2 to 8 seconds.
Underneath, or to the side, whatever, you've 6 boxes showing the 6 colours (which could appear in the that first main box)
The user has to choose the right colour - i.e one of these 6 boxes - which match to the colour shown in that main image.
Is that how your game is?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@gyroscope Yep pretty much, just something relatively basic for my first game
Hey, don't worry, I'm not judging your idea! Just trying to understand what you want to achieve, to see if I can help you.
OK, if I've understood it correctly then, try this approach to see if it works for you:
(The following is based on the assumption your possible colours are actually shown as images, rather than made with RGB colour attributes) Also not far off what @AlkaPP suggested.
In your main actor which changes its colour randomly:
And in each of your 6 coloured boxes, put the following, changing the number accordingly, so for the first one:
for the second one:
ETC., for the other 4 buttons.
That should work out, I think.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Thanks very much, will give it a go!
Works wonderfully now, thanks very much, really appreciate the help!