How can I change the color of drawn oval?
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MyWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyWorld extends World
{
private static int _Width = 50;
private static int _Height = 50;
/**
* Constructor for objects of class MyWorld.
*
*/
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
for(int i = 0; i < 10; i++)
{
GreenfootImage image = new GreenfootImage(_Width, _Height);
image.fillOval(0, 0, _Width, _Height);
Ball ball = new Ball();
ball.setImage(image);
addObject(ball, Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
}
}
}
