示例#1
0
  public shit() {
    this.addWindowListener(this);
    setSize(1280, 720);
    setVisible(true);

    r = new Random();
    //		ap = new AudioPlayer();//THIS SHIT DOESN'T WORK WHAT THE F**K DEHOWE
    timer = System.currentTimeMillis();
    options.add("");
    options.add("");
    options.add(""); // These 3 lines are to populate options.
    state = 1; // The first line will always be a story panel so the state is 1.
    try {
      URL url = getClass().getResource("options.png");
      obox = ImageIO.read((url));
      url = getClass().getResource("Text Boxes.png");
      textBox = ImageIO.read(url); // reads in the text boxes file.
      p = new parser("Introduction.txt"); // reads in the story file.
      progress(); // the function that calls going through to the next line
    } catch (IOException e) {
      e.printStackTrace();
    }

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {
      URL url = getClass().getResource("sspr.ttf");
      ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, url.openStream()));
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    resize(SCREENWIDTH, SCREENHEIGHT); // Makes the applet the size we want it
    addMouseListener(this); // Lets us use mouse
    addKeyListener(this); // Lets us use keyboard

    Thread t = new Thread(this);
    t.start();
  }