@Override
	public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
//		font40 = new AngelCodeFont("res/fonts/04b03.fnt", new Image("res/fonts/04b03_0.png"));
		font24 = new AngelCodeFont("res/fonts/font24.fnt", new Image("res/fonts/font24_0.png"));
		font16 = new AngelCodeFont("res/fonts/font16.fnt", new Image("res/fonts/font16_0.png"));
//		font8 = new AngelCodeFont("res/fonts/04b03_8.fnt", new Image("res/fonts/04b03_8_0.png"));
		
		redEffect = new Image("res/redEffect.png");
		blackEffect = new Image("res/blackEffect.png");
		alpha = 0;
		redEffect.setAlpha(alpha);
		blackEffect.setAlpha(alpha);
		loadingLevel = true;
		
		gameOver = false;
		theendAlpha = 0;
		creditsAlpha = 0;
		theendTimer = 0;
		soundPlayed = false;
		die = new Sound("res/sounds/body.wav");
		
		new Sounds();
		
		// elevator sprites
		Image[] elevIdle = new Image[8];
		Image[] elevOpen = new Image[22];
		
		int a = 100, b = 100;
		int[] idleDur = { a, a, a, a, a, a, a, a };
		int[] openDur = { b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b };
		elevatorIdle = new Animation(elevIdle, idleDur, true);
		elevatorOpen = new Animation(elevOpen, openDur, true);
		
		level = 0;
		initLevel();
		
		// particles
		try{
			Image image = new Image("res/particle/square.png", false);
			particles = new ParticleSystem(image, 1500);
			particles.setRemoveCompletedEmitters(true);
			File xml = new File("res/particle/pillParticle.xml");
			pillEmitter = ParticleIO.loadEmitter(xml);
		}
		catch(Exception e){
			e.printStackTrace();
		}
		
		particles.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
		ConfigurableEmitter e;
		e = pillEmitter.duplicate();
		e.setPosition(100, 100, false);
		
		e.setEnabled(false);
		particles.addEmitter(e);
		
		Image[] pills = new Image[11];
		int[] dur = new int[11];
		for(int i = 0 ; i < pills.length ; i++){
			pills[i] = new Image("res/pillAnimation/" + (i+1) + ".png");
			dur[i] = 80;
		}
		
		pill = new Animation(pills, dur, true);
		theend = new Image("res/theend.png");
		credits = new Image("res/credits.png");
	}