True, but in my previous version of the code, I didn't change it either yet it still yielded results. Either that or I'm ignorant to what is going wrong.
timer--;
timer--;
if (timer == 145*60)
addObject(text1,117,427);
timer--;
if (timer == 140*60)
addObject(text2,117,627);import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.List;
public class IntroSequence extends World
{
private int timer = 9000;
Text1 text1 = new Text1();
Text2 text2 = new Text2();
List objects = getObjects(null);
public IntroSequence()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(800, 600, 1);
prepare();
act();
}
public void act()
{
timer--;
if (timer == 148*60)
addObject(text1,117,427);
if (timer == 147*60)
addObject(text2,309,502);
if (timer == 144*60)
removeObjects(objects);
}removeObjects(getObjects(null));
//This...
if (timer == 148*60) addObject(text1,117,427);
//... is the same as
if (timer == 148*60)
{
addObject(text1,117,427);
//but here you can add more statements if needed
}switch (--timer)
{
case 148*60:
addObject(text1,117,427);
break;
case 147*60:
addObject(text2,309,502);
break;
case 144*60:
removeObjects(getObjects(null));
// add new text here
break;
// etc.
case 0:
Greenfoot.setWorld(nextWorld);
break;
}