Hi im curentlly having issues with my leveling system. I will change the whole code to fix it btw. i am making a level selection screenfor players to be able to select their own levels, rather than making it change for them automaticly when they beat one. i am using a modified version of dampost's level class senario, since i could only study the code, and not run it to see what every bit of code did. here is my code for the leveling system in level 1, and my selection screen. im only ptting in level 1 since it's value only changes with my other levels (its just coppied code addaped to fit teh new level.
selection screen
level 1
private void LevelSpawner()
{
addObject(new levelButton(Image[0]), 100,135);
if (level == 1)
{
addObject(new levelButton(Image[1]), 250,200);
}
if (level == 2)
{
addObject(new levelButton(Image[2]), 400,135 );
}
}
public void setFields()
{
Levels levels = new Levels();
if (Level1.er1 == 0)
{
level = 1;
}
if(Level2.er2 == 0)
{
level = 2;
}
} Levels levels = new Levels();
//er1 is counting down however many enemy's are remaining for that proticicular level
if (er1 == 0)
{
level = 1;
stopped();
Greenfoot.setWorld(levels);
}
