import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

import javax.swing.*;
/**
 * Write a description of class Arena here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Arena extends World
{
    Counter punkteZaehler = new Counter();
    int level;
   
    public Arena()
    {    
        super(600, 400, 1); 
        Menu menu = new Menu();
        addObject(menu, 300, 200 );
    }

    public void setLevel(int pLevel)
    {
        level = pLevel;
        prepare();
    }
    
    private void prepare()
    {
        removeObjects(getObjects(null));
        switch(level)
        {
            case 1:
                for (int mZaehler = 1; mZaehler <=10; mZaehler++)
                {
                    addObject(new Zielpunkt(),Greenfoot.getRandomNumber(500) + 50, Greenfoot.getRandomNumber(300) + 50);
                }
                addObject(punkteZaehler,569,389); 
                addObject(new BoxautoBlau(),450,100);
                addObject(new Krankenwagen(),50,50);
                break;
            case 2:
                for (int mZaehler = 1; mZaehler <=10; mZaehler++)
                {
                    addObject(new Zielpunkt(),Greenfoot.getRandomNumber(500) + 50, Greenfoot.getRandomNumber(300) + 50);
                }
                addObject(new BoxautoBlau(),450,100);
                addObject(new BoxautoGruen(),250,180);
                addObject(punkteZaehler,569,389);
                addObject(new Krankenwagen(),50,50);
                break;
            case 3:
                for (int mZaehler = 1; mZaehler <=10; mZaehler++)
                {
                    addObject(new Zielpunkt(),Greenfoot.getRandomNumber(500) + 50, Greenfoot.getRandomNumber(300) + 50);
                }
                addObject(punkteZaehler,569,389);
                addObject(new BoxautoBlau(),450,100);
                addObject(new BoxautoGruen(),250,180);
                addObject(new BoxautoRot(),350,300);
                addObject(new Krankenwagen(),50,50);
                break;
            case 4:
            for (int mZaehler = 1; mZaehler <=10; mZaehler++)
            {
                addObject(new Zielpunkt(),Greenfoot.getRandomNumber(500) + 50, Greenfoot.getRandomNumber(300) + 50);
            }
            addObject(punkteZaehler,569,389);
            addObject(new BoxautoBlau(),450,100);
            addObject(new BoxautoGruen(),250,180);
            addObject(new BoxautoRot(),350,300);
            addObject(new BoxautoRot(),100,300);
            addObject(new Krankenwagen(),50,50);
            break;
        }
     }    
}
