Final Project Problem Solving

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.

Screen Shot 2015-01-25 at 16.50.27

The evaluateChange method has three parameters, a float variable, and two color variables.

Screen Shot 2015-01-25 at 16.44.44Screen Shot 2015-01-25 at 16.44.52

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.

Screen Shot 2015-01-25 at 16.43.38Screen Shot 2015-01-25 at 17.05.15

Previous code: Each tower is being assigned to one colour (c2).

Screen Shot 2015-01-25 at 16.43.47Screen Shot 2015-01-25 at 17.06.07

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s