Hello. I am having trouble with both making the world (the squares) of my game green and fitting the "Wall" class into a square of the grid (my world).
Here is the code for the World class:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
public class OppositeWorld extends World
{
public final static int CELL_SIZE = 40;
public OppositeWorld()
{
super(30, 30, 20, false);
GreenfootImage img = new GreenfootImage(CELL_SIZE, CELL_SIZE);
img.drawRect(0, 0, CELL_SIZE-1, CELL_SIZE-1);
setBackground(img);
img.setColor(Color.GREEN);
img.fill();
addObject(new Wall(), 3, 3);
}
}
Here is the code for the "Wall" class:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class Wall extends Actor
{
public Wall()
{
this(40);//call the other constructor
}
/**
* Overload the constructor
*/
public Wall(int size)
{
GreenfootImage img = new GreenfootImage(size,size);
img.fill();
setImage(img);
}
}
Thank you very much.

