In my last post I discussed a problem I was having with the towers movement. I have recently solved this problem and I realised that it was because all my images’ colours were assigned to one colour.
The evaluateChange method has three parameters, a float variable, and two color variables.
The left image is what my code was previously, the right image is what I changed. As can be seen in the first screenshot the second parameter for each image is “c2” this means that every colour value being found by the camera using the get function was using the same colour to compare brightness with, which means I wasn’t getting the reaction I intended because the images were not independent from one another and were using the same colour values.
Previous code: Each tower is being assigned to one colour (c2).
I had to create new color variables for each tower image so that they would all be comparing the previous brightness to the brightness that was being captured by the camera from each individual pixel.
Now that I have resolved this problem I feel that i am ready to test my project in the foyer at weymouth house.