@Override
    public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
        this.sbg = sbg;
        gc.setShowFPS(false);
        txtName = new TextField(gc, ttf, 148, 27, 320, 27, new ComponentListener() {
            public void componentActivated(AbstractComponent source) {
                System.out.println("Entered1: ");
                txtName.setFocus(true);
            }
        });
        txtName.setMaxLength(18);
        background = new Image("data/charSelectMain.png");
        generate = new Image("data/generatename.png");
        random = new Image("data/randomize.png");
        done = new Image("data/done.png");
        back = new Image("data/Back.png");// need a back button
        areas[0] = new MouseOverArea(gc, generate, 530, 8, this);
        areas[1] = new MouseOverArea(gc, random, 503, 245, this);
        areas[2] = new MouseOverArea(gc, done, 321, 533, this);
        areas[3] = new MouseOverArea(gc,back,500,533,this);

        int i = 4;
        int y = 305;
        for (String s : buttons1) {
            Image im = new Image("data/left.png");
            areas[i] = new MouseOverArea(gc, im, 204, y, this);
            y = y + 38;
            i++;
        }

        int i2 = 8;
        int y2 = 305;
        for (String s : buttons1) {
            Image im = new Image("data/right.png");
            areas[i2] = new MouseOverArea(gc, im, 324, y2, this);
            y2 = y2 + 38;
            i2++;
        }

        int i3 = 13;
        int y3 = 300;
        for (String s : buttons2) {
            Image im = new Image("data/left.png");
            areas[i3] = new MouseOverArea(gc, im, 630, y3, this);
            y3 = y3 + 38;
            i3++;
        }

        int i4 = 17;
        int y4 = 300;
        for (String s : buttons2) {
            Image im = new Image("data/right.png");
            areas[i4] = new MouseOverArea(gc, im, 745, y4, this);
            y4 = y4 + 38;
            i4++;
        }

        for (String s : playerTypes) {
            SpriteSheet spritesheet = new SpriteSheet("data/" + s + "_f.png", 32, 36);
            Image[] movementDown = {spritesheet.getSprite(0, 2), spritesheet.getSprite(1, 2), spritesheet.getSprite(2, 2), spritesheet.getSprite(1, 2)};
            int[] duration = {300, 300, 300, 300};
            Animation down = new Animation(movementDown, duration, false);
            PlayerSprite ps = new PlayerSprite(down, s + "_f");
            ps.setSpriteSheet(spritesheet);
            female.add(ps);
        }

        for (String s : playerTypes) {
            SpriteSheet spritesheet = new SpriteSheet("data/" + s + "_m.png", 32, 36);
            Image[] movementDown = {spritesheet.getSprite(0, 2), spritesheet.getSprite(1, 2), spritesheet.getSprite(2, 2), spritesheet.getSprite(1, 2)};
            int[] duration = {300, 300, 300, 300};
            Animation down = new Animation(movementDown, duration, false);
            PlayerSprite ps = new PlayerSprite(down, s + "_m");
            ps.setSpriteSheet(spritesheet);
            male.add(ps);
        }

        activeSprite = female.get(0).getAnimation();

        int y5 = 305;
        for (String s : buttons1) {
            StatAllocation stat = new StatAllocation(10, s, new Position(258, y5));
            stats.add(stat);
            y5 = y5 + 38;
        }

        int y6 = 300;
        for (String s : buttons2) {
            StatAllocation stat = new StatAllocation(10, s, new Position(688, y6));
            stats.add(stat);
            y6 = y6 + 38;
        }

        StatAllocation stat = new StatAllocation(10, "remaining", new Position(422, 258));
        stats.add(stat);

    }