the characters fall through the platform but the same code works on my other levels
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* This class Level3 displays the third level for the user to play.
*
* Jacqueline Reilly
* January 18, 2017
*/
public class Level3 extends World
{
Counter counter = new Counter ();
PlanktonCounter PCounter = new PlanktonCounter ();
/**
* Constructor for objects of class Level3.
*
*/
public Level3()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(950, 700, 1);
//Adding counter
addObject(counter, 100, 100);
addObject (PCounter, 800, 100);
//Making background fit the screen
GreenfootImage Bg = new GreenfootImage ("background.jpg");
Bg.scale (getWidth (), getHeight ());
setBackground (Bg);
//Adding the platforms
PlatformLevel3 platform = new PlatformLevel3 ();
addObject (platform, 160, 633);
PlatformLevel3 platform1 = new PlatformLevel3 ();
addObject (platform1, 501, 511);
PlatformLevel3 platform2 = new PlatformLevel3 ();
addObject (platform2, 792, 357);
//Adding characters
addObject (new MrKrabs(), 90, 518);
addObject (new Plankton(), 188, 497);
//Adding object for Mr. Krabs to collect
KrabbyPatty krabbyPatty = new KrabbyPatty ();
addObject (krabbyPatty, 488, 404);
KrabbyPatty krabbyPatty1 = new KrabbyPatty ();
addObject (krabbyPatty1, 865, 255);
//Adding object for Plankton to collect
FormulaBottle bottle = new FormulaBottle ();
addObject (bottle, 300, 416);
FormulaBottle bottle1 = new FormulaBottle ();
addObject (bottle1, 681, 220);
}
public Counter getCounter(){
return counter;
}
public PlanktonCounter getPlankton() {
return PCounter;
}
}
