I have some fairly simple code that makes Greenfoot crap itself.
World Code:
Object Code (extends Actor):
I have no idea why this doesn't work. Maybe its my computer, but when I do this, it looks like this when I add wall object:
Greenfoot
As you can see, the entire world becomes the same color as the Wall object. Also, whatever button my mouse happens to be hovering over is placed into the top left corner of the world for whatever reason.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class MainScreen extends World
{
public MainScreen()
{
super(600, 600, 1);
GreenfootImage bg1 = new GreenfootImage(getWidth(), getHeight());
bg1.setColor(new Color(25, 255, 25));
bg1.fill();
bg1.setTransparency(75);
setBackground(bg1);
}
public void act()
{
}
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
public class Wall extends Actor
{
private GreenfootImage image1 = new GreenfootImage(32, 32);
protected void addedToWorld(World world)
{
image1.setColor(new Color(0, 255, 0));
image1.fill();
setImage(image1);
}
public void act()
{
}
}