public class MyWorld extends World
{
// GLOBAL DECLARATIONS
// ===================
int actCount=0;
// CONSTRUCTOR (populate world here)
// ===========
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(800, 800, 1);
Ship s1;
s1= new Ship();
addObject(s1,400,600);
Alien a1;
a1= new Alien();
addObject(a1,0,200);
} // end constructor
// ACT METHOD (often left empty in World subclass)
// ==========
public void act()
{
actCount++;
showText(""+actCount,50,500);
//if the actCount is equal to 100 act cycles then add three aliens and add alien counter
//resets the actCounter
if(actCount==100)
{
addObject(new Alien(),0,100);
addObject(new Alien(),0,200);
addObject(new Alien(),0,300);
addObject(new forerunner(),799,100);
addObject(new forerunner(),799,200);
addObject(new forerunner(),799,300);
actCount=0;
}
} // end act
} // end class
