So i was messing around and then i started to notice that things that i didn't put there are showing up there I don't have code that would add it in except in the world and i make sure to remove everything before going on to the next case so here's the code if anyone needs it later on
From the World class
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
* Write a description of class TutorialLvl here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class WorldLoader extends World
{
//private Egg egg = new Egg();
static GreenfootImage background;
static GreenfootImage bgmask;//bg means background
GreenfootImage image;
static int swidth=700;//S means Super
static int sheight=500;//S means Super
static GreenfootImage codes = new GreenfootImage("codes.gif");// The colors of grounds
static Color groundColor;
static Color AIColor;//AI means Artifical Intenigents
static Color spikeColor;
static Color haxColor;
static Color secondGroundColor;
static int currentLevel = 0;
static int maxLevel = 99;//total amount of levels
static public int playerx, playery;//for enemies
static public int startx, starty;//the starting place of the player
/**
* Constructor for objects of class TutorialLvl.
*
*/
public WorldLoader()
{
super(swidth, sheight, 1);
setColors();// this sets the colors for all of the other actors
restartGame();
setPaintOrder(Egg.class,Door.class);
}
public void act()
{
lastlevel();
otherStuffThatHappen();
}
private void lastlevel()
{
if (currentLevel == 10
&& playerx > 300
&& playery < 100
)
{
changeLevel();
}
}
private void setColors()
{
groundColor = codes.getColorAt(1,1);//black
AIColor=codes.getColorAt(22,1);//red
spikeColor = codes.getColorAt(57,1);//yellow
haxColor = codes.getColorAt(40,1);//green
secondGroundColor = codes.getColorAt(68,1);//cyan
}
public boolean isGround(Color mg)
{
if (groundColor.equals(mg))
{return true;}
return false;
}
public boolean isGround(int x, int y)
{
if (x > swidth-1 || x < 0 || y > sheight-1 || y < 0) {return false;}
Color ez = bgmask.getColorAt(x,y);
if (groundColor.equals(ez))
{return true;}
return false;
}
public boolean isSecondGround(Color mg)
{
if(secondGroundColor.equals(mg))
{return true;}
return false;
}
public boolean isSecondGround(int x, int y)
{
if(x>swidth-1||x<0||y>sheight-1||y<0){return false;}
Color ez=bgmask.getColorAt(x,y);
if(secondGroundColor.equals(ez))
{return true;}
return false;
}
public boolean isPatrol(int x, int y)
{
if (x > swidth-1 || x < 0 || y > sheight-1 || y < 0) {return false;}
Color ez = bgmask.getColorAt(x,y);
if (AIColor.equals(ez))
{return true;}
return false;
}
public boolean isInstaDeath(int x, int y)
{
if (x > swidth-1 || x < 0 || y > sheight-1 || y < 0) {return false;}
Color ez = bgmask.getColorAt(x,y);
if (haxColor.equals(ez))
{return true;}
return false;
}
public boolean isSpike(int x, int y)
{
if (x > swidth-1 || x < 0 || y > sheight-1 || y < 0) {return false;}
Color ez = bgmask.getColorAt(x,y);
if (spikeColor.equals(ez))
{return true;}
return false;
}
static public void paintBg(int x, int y)
{
background.setColorAt(x,y, Color.RED);
background.setColor(Color.RED);
background.fillRect(x,y, 10,10);
}
public void setPlayerCoords(int px, int py)
{
playerx=px;
playery=py;
}
public void cleanUp()
{
this.removeObjects(this.getObjects(Egg.class));
this.removeObjects(this.getObjects(Door.class));
this.removeObjects(this.getObjects(Fall.class));
this.removeObjects(this.getObjects(Consumables.class));
this.removeObjects(this.getObjects(OtherConsumables.class));
this.removeObjects(this.getObjects(ChoseStory.class));
this.removeObjects(this.getObjects(BadGuys.class));
this.removeObjects(this.getObjects(MonsterSpawner.class));
}
public void changeLevel()
{
currentLevel++;
if(currentLevel > maxLevel)
{
currentLevel=0;
}
setLevel(currentLevel);
}
public void restartLevel()
{
setLevel(currentLevel);
}
public void restartGame()
{
currentLevel=0;
setLevel(currentLevel);
}
public void setLevel(int i)
{
if (i <0 || i > maxLevel) {return;}
cleanUp();
currentLevel=i;
switch(i)
{
case 0: testLvl(); break;
case 1: testLvl2(); break;
case 2: EzLvl(); break;
case 3: RiskyMove(); break;
case 4: TestLvlChange(); break;
case 5: RiskTake(); break;
case 6: SecondGroundTest(); break;
case 7: Smurt(); break;
case 8: Time(); break;
//Play as the good guy
case 9: IntroDuction(); break;
case 10:JgAreaLvl1To2(); break;
case 11://reserved
case 12://reserved
case 13:JgAreaLvl2To5();break;
case 14://reserved
case 15://reserved
//Play as the bad guy
case 16:BadIntroDuction(); break;
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
//Die Forever
case 23: LOL(); break;
}
}
public void otherStuffThatHappen()
{
if(Egg.foodType==1)
{
background=new GreenfootImage("ChangeBackground2.png");
setBackground(background);
bgmask=new GreenfootImage("TestMaskChange2.png");
Egg.foodType=0;
}
if(Egg.foodType==2)
{
background=new GreenfootImage("OrNahBackground.png");
setBackground(background);
bgmask=new GreenfootImage("OrNahMask.png");
Egg.foodType=0;
}
}
public void testLvl()
{
background= new GreenfootImage("BackGroundTest.png");
setBackground(background);
bgmask = new GreenfootImage("MaskTest.png");
startx= 130;
starty=10;
addObject(new Egg(), startx,starty);
//addObject(new Door(false,0), 100,445);
addObject(new ChoseStory(9,1),100,445);
}
public void testLvl2()
{
background=new GreenfootImage("SpikeTestBackground.png");
setBackground(background);
bgmask= new GreenfootImage("SpikeTestMask.png");
startx=0;
starty=0;
addObject(new Egg(), startx,starty);
addObject(new Door(false,1), 600,100);
}
public void EzLvl()
{
background=new GreenfootImage("EzLvlBackGround.png");
setBackground(background);
bgmask=new GreenfootImage("EzLvlMask.png");
startx=680;
starty=20;
addObject(new Egg(), startx, starty);
addObject(new Door(false,2), 540,200);
}
public void RiskyMove()
{
background=new GreenfootImage("LavaBackGround.png");
setBackground(background);
bgmask=new GreenfootImage("LavaMask.png");
startx=120;
starty=320;
addObject(new Egg(),startx,starty);
addObject(new Door(false,3),130,130);
}
public void TestLvlChange()
{
background= new GreenfootImage("ChangeBackground.png");
setBackground(background);
bgmask=new GreenfootImage("TestMaskChange.png");
startx=20;
starty=335;
addObject(new Egg(),startx,starty);
addObject(new Consumables(0),20,120);
addObject(new Door(false,3),650,330);
}
public void RiskTake()
{
background=new GreenfootImage("RiskItBackground.png");
setBackground(background);
bgmask=new GreenfootImage("RiskItMask.png");
startx=25;
starty=300;
addObject(new Egg(),startx,starty);
addObject(new Consumables(1),500,10);
addObject(new Door(false,1),650,330);
for(int i=0;i<3;i++)
{
addObject(new OtherConsumables(0),490,90+90*i);
}
}
public void SecondGroundTest()
{
background=new GreenfootImage("2edGroundTestBackground.png");
setBackground(background);
bgmask=new GreenfootImage("2edGroundTestMask.png");
startx=50;
starty=390;
addObject(new Egg(),startx,starty);
addObject(new Door(false,2),660,150);
}
public void Smurt()
{
background=new GreenfootImage("SmartBackground.png");
setBackground(background);
bgmask=new GreenfootImage("SmartMask.png");
startx=10;
starty=240;
addObject(new Egg(),startx,starty);
addObject(new Door(false,3),670,400);
}
public void Time()
{
background=new GreenfootImage("ItsTimeBackground.png");
setBackground(background);
bgmask=new GreenfootImage("ItsTimeMask.png");
startx=0;
starty=380;
addObject(new Egg(),startx,starty);
addObject(new ChoseStory(9,1),650,240);
addObject(new ChoseStory(21,2),40,80);
addObject(new ChoseStory(33,0),650,20);
}
//GoodGuy
public void IntroDuction()
{
background=new GreenfootImage("GoodGuyVillageBackground.png");
setBackground(background);
bgmask=new GreenfootImage("GoodGuyVillageMask.png");
startx=0;
starty=400;
addObject(new Egg(),startx,starty);
addObject(new ChoseStory(10,3),30,50);
addObject(new ChoseStory(11,4),460,25);
addObject(new ChoseStory(12,5),650,140);
}
public void JgAreaLvl1To2()
{
background=new GreenfootImage("Lvl1-2JgAreaBackGround.png");
setBackground(background);
bgmask=new GreenfootImage("Lvl1-2JgArea.png");
startx=0;
starty=330;
addObject(new Egg(),startx,starty);
addObject(new ChoseStory(13,3),300,440);
addObject(new MonsterSpawner(1),540,250);
addObject(new MonsterSpawner(1),300,10);
}
public void JgAreaLvl2To5()
{
background=new GreenfootImage("GoodGuyVillageBackground.png");
}
//BadGuy
public void BadIntroDuction()
{
}
//Just... Um yah
public void LOL()
{
}
}

