luke6728 wrote...
Does the first block of code you have given me all go in the world constructor?
/** import statements */
public class ClassName extends SuperClassName
{
/** all static fields, initializers and methods */
/** all instance fields (non-static fields) */
/** all constructors -- like 'public ClassName() {...} ' */
/** all instance methods -- like, 'public void act() {...}' */
}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);
}
public void act()
{
if (startTime == 0) startTime = System.currentTimeMillis();
else if (startTime+1000 <= System.currentTimeMillis())
{
counter2.add(1);
startTime = System.currentTimeMillis();
}
}
}counter2 = new Counter2();