Hi, I found a Code, were I can make a Pop-up Message, but this Code doesn't work for me, so I'd like to ask, what is wrong with it.
I always get the Error: Jawa.awt.Color cannot be converted to Greenfoot.Color, at this part of the Code
I would love, if someone could help me.
import greenfoot.*;
import java.awt.Color;
public class GameOver extends Actor
{
String text = " GAME OVER! \n YOU WIN! ";
GreenfootImage inner = new GreenfootImage(text, 48, Color.black, new Color(0, 0, 0, 96));
public GameOver()
{
}
// create a gameover image the size of the world
public void addedToWorld(World world)
{
int wide = world.getWidth();
int high = world.getHeight();
GreenfootImage outer = new GreenfootImage(wide, high);
int leftX = (wide - inner.getWidth())/2;
int topY = (high - inner.getHeight())/2;
outer.drawImage(inner, leftX, topY);
setImage(outer);
}
// the following is optional
// remove pop-up when clicked on
public void act()
{
if (Greenfoot.mouseClicked(this))
{
getWorld().removeObject(this);
}
}
}GreenfootImage inner = new GreenfootImage(text, 48, Color.black, new Color(0, 0, 0, 96));