@Override
	public void init(GameContainer gc, final StateBasedGame arg1)
			throws SlickException {
		super.init(gc, arg1);
		
		this.showDialog("Welcome to the birdsimulator 2.0!\nAt the top you will see the available behaviors and the keys to toggle them, "
				+ "\nplease use them wisely because we recently had some reports of animal abuse...");
		this.showDialog("No seriously, we love those little birds.");
		this.showDialog("Maybe if we really loved them, we shouldn't have implanted chips in their brains.\n"
				+ "Oh well, go ahead!\n"
				+ "Before I forget, you can control the dragonite with WASD. \nYou can't use the arrow keys, because someone spilled their drink over it and now\n"
				+ "they're stuck.");
		this.showDialog("One last thing, press ESC when you're finished.");
		this.checkDialogs();
		
		for(int i = 0; i < 10; i++) {
			obstacles.add(new Obstacle(
					new Vector2(random.nextInt(780), random.nextInt(580)),
					new Vector2(1f, 1f),
					20f
				));
		}
		for(int i = 0; i < 10; i++) {
			birds.add(
					new Bird(
							new Vector2(i * 40, i * 40),
							5f,
							new Vector2(0f, 0f),
							5f,
							new Vector2(0f, 0f),
							2f,
							new Vector2(1f, 1f),
							2f,
							5f,
							this
							)
					);
		}
		
		controlledBird = new ControlledBird(new Vector2(400, 300), 5f, new Vector2(0f, 0f),	5f,
				new Vector2(0f, 0f), 2f, new Vector2(1f, 1f), 2f, 5f, this);
		backgroundImage = new Image("res/sprites/birdminigame/bg.png");
		
		
		gc.getInput().addKeyListener(new KeyListener() {

			@Override
			public void inputEnded() {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void inputStarted() {
				// TODO Auto-generated method stub
				
			}

			@Override
			public boolean isAcceptingInput() {
				// TODO Auto-generated method stub
				return GameInfo.getInstance().stateGame.getCurrentStateID() == getID();
			}

			@Override
			public void setInput(Input arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void keyPressed(int arg0, char chr) {
				System.out.println("Key " + arg0);
				if(arg0 >= 2 && arg0 <= 6) { //key between 1 and 5
					for(Bird b : birds) {
						b.toggle(arg0 - 2);
					}
				}
				if(arg0 == Input.KEY_ESCAPE) {
					arg1.enterState(PlayingGameState.PLAYING_STATE_ID);
				}
			}

			@Override
			public void keyReleased(int arg0, char arg1) {

			}
			
		});
		
	}