I need Help!!!
// instance fields in world class
private Counter counter;
private long startTime;
// in constructor of world class
counter = new Counter();
// in act or method it calls (still world class)
if (startTime == 0) startTime = System.currentTimeMillis();
else if (startTime+1000 <= System.currentTimeMillis())
{
counter.add(1);
startTime = System.currentTimeMillis();
}import greenfoot.*;
/**
* Write a description of class Level2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Level2 extends World
{
private Counter2 counter2;
private long startTime;
/**
* Constructor for objects of class Level2.
*
*/
public Level2()
{
super(1050, 800, 1);
counter2=new Counter2();
if(startTime==0)startTime=System.currentTimeMillis();
else if(startTime+1000<=System.currentTimeMillis())
{
counter2.add(1);
startTime=System.currentTimeMillis();
}
}
}public Level2()
public void act()