Colouring in GS
2004184
Member Posts: 14
I've been looking everywhere to find the solution, but didn't find anything yet.
I've created a game in which you need to fill actors with a certain colour. You can pick the colour in the colourmenu. I want this: if you click on a colour, and after that you click on the actor, that the actor becomes the colour you clicked on. I saw several games with something like this in it, but I can't figure out how to do this in GameSalad!
Hope someone is willing to help me, many thanks in advance!
- Mareille
I've created a game in which you need to fill actors with a certain colour. You can pick the colour in the colourmenu. I want this: if you click on a colour, and after that you click on the actor, that the actor becomes the colour you clicked on. I saw several games with something like this in it, but I can't figure out how to do this in GameSalad!
Hope someone is willing to help me, many thanks in advance!
- Mareille
Comments
You can download my project there. Pretty much, one or more actors control game attributes for Red/Green/Blue values (which are real type values between 0 and 1), and your actor uses those game attributes to change its own color attributes.
Many thanks!
RULE (ALL)
when touch is pressed
attribute game.color = 1
change attribute self.color to whatever
RULE (ALL)
when touch is pressed
attribute game.color = 2
change attribute self.color to whatever
and so on for each color and in each actor to be colored. Lot of rules but it should work.
In the actor have a rule that says
Rule (ALL)
when touch is pressed
when attribute game.colortest = 1
change image to image1
----------
Rule (ALL)
when touch is pressed
when attribute game.colortest = 2
change image to image2
Then drop this in a scene. Go into the attributes and manually set colortest to 1.
Then preview it and click on the actor. Does image1 appear?
Go back into the attributes manually change it 2. Preview it. Click on the actor does image2 show up? This will tell you if the above rules are correct. If this works than something else is wrong in your app.
The other thing to try in the project you are working on is to have an actor that has a text display behavior and have it display the game integer attribute you are using. does it show the game attribute correctly when you select a color? maybe your color selection rules aren't correct?
Oh and thanks for all your help so far!
When touched is pressed
change attribute game.changecolor to 2
Thank you so, so much!!