I have a critter that changes its neighbors to be any random color EXCEPT red. I have code to change to a random color, but I'm unsure of how to go about checking to see if the color is red and how to change it to another random color. Here is my code so far:
for (Actor a : actors)
{
int r= (int) (Math.random()*256);
int g= (int) (Math.random()*256);
int b= (int) (Math.random()*256);
a.setColor(new Color(r,g,B ));
}
This post has been edited by elisemarie15: 22 May 2011 - 09:08 PM

New Topic/Question
Reply


MultiQuote






|