I removed the first words in the two lines you mentioned, and true from the other part of the code, but now it says ( or import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class paper here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class paper extends World
{
private Frog frog;
private Snake snake;
/**
* Constructor for objects of class paper.
*
*/
public paper()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
prepare();
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
*/
private void prepare()
{
fly fly = new fly();
addObject(fly,368,204);
fly fly2 = new fly();
addObject(fly2,473,123);
fly fly3 = new fly();
addObject(fly3,467,347);
fly fly4 = new fly();
addObject(fly4,170,101);
fly fly5 = new fly();
addObject(fly5,216,333);
Label label = new Label("Frog: 0");
Marker marker= new Marker("Snake: 0");
frog = new Frog(label);
addObject(frog, 100, 100);
snake = new Snake(marker);
addObject(snake,76,150);
frog.setLocation(77,223);
frog.setLocation(69,245);
addObject(marker,571,21);
marker.setLocation(563,23);
marker.setLocation(576,14);
marker.setLocation(528,23);
marker.setLocation(573,69);
marker.setLocation(555,18);
marker.setLocation(569,15);
marker.setLocation(559,15);
marker.setLocation(541,20);
addObject(label,51,36);
label.setLocation(63,21);
marker.setLocation(531,17);
marker.setLocation(544,19);
label.setLocation(26,13);
label.setLocation(52,12);
marker.setLocation(550,20);
label.setLocation(96,21);
marker.setLocation(562,17);
marker.setLocation(562,26);
fly.setLocation(328,193);
snake.setLocation(48,57);
frog.setLocation(38,359);
}
public void act()
{
if (getObjects(fly.class).isEmpty())
{
Greenfoot.stop();
}
if(frog.acount > snake.bcount)
{
FrogWins frogwins= new FrogWins();
addObject(new FrogWins, getWidth()/2, getHeight()/2);
Greenfoot.stop();
return;
}
if(frog.acount < snake.bcount)
{
SnakeWins snakewins= new SnakeWins();
addObject(new SnakeWins, getWidth()/2, getHeight()/2);
Greenfoot.stop();
return;
}
}
}
