I don't know what went wrong... It wont compile and I don't know why
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Play here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Play extends World
{
private static int aliencount=1;
/**
* Constructor for objects of class Play.
*
*/
public Play()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(800, 550, 1);
prepare();
}
public void act()
{
spawn();
}
/**
* Prepare the world for the start of the program. That is: create the initial
* objects and add them to the world.
*/
private void prepare()
{
Rocket rocket = new Rocket();
addObject(rocket,130, 286);
}
public void spawn()//spawn for aliens
{
if (getObjects(Alien.class).size() < alienCount)
{
addObject(new Alien(), (800), Greenfoot.getRandomNumber(550));
}
}
}
