I don't understand why the red field is always zero.
This code should change it.
**
* Act - do whatever the RedPick wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.mouseClicked(this)) // This statement checks to see if this object has been clicked on by the mouse
{
PongCourt pongCourt = new PongCourt();
Greenfoot.setWorld(pongCourt); // This statement sets the world to PongCourt
pongCourt.red = 1; // This statement assigns the variable red the value of 1, which is true
pongCourt.blue = 1; // This statement assigns the variable blue the value of 0, which is false
// redPaddle.playerRedControlled = true; // This statement assigns the variable playerRedControlled the value of true
// blue.playerBlueControlled = false; // This statement assigns the variable playerBlueControlled the value of false
}
}
