Colour checking and reseting
in
Programming Questions
•
2 years ago
I am trying to get a function that checks the colour of a shape, and if it's red value is above z, and another shape is inside it, then the shape is reset to position x and y.
I am having really trouble writing this and have been struggling for several days. Code that peers are telling me to try seem to do nothing, here's the latest
void resetCheck()
{
loadPixels();
redValue = get (int(PosX), int(PosY));
if (red(redValue) >= redThreshold)
{
PosX = 25;
PosY = 25;
}
}
The only problem with this I see is that PosX and PosY are the center positions of a yellow circle, and not of the flashing squares behind them that I want the red value of,
this function is contained in a class and the flashing square in another class
this function is contained in a class and the flashing square in another class
1