Example #1
0
  /** Called on game start */
  public void setup() {
    instance = this;
    ground = false;
    isFlyMode = false;
    screenSelected = OptionsScreenEnum.mainScreen;

    LogHelper.init();
    SaveData.initDirectory(this);
    RegistryRegistry.init(this);
    IconHelper.init(this);
    player = new Player(width / 2, 0, this);
    Block.blockInit();

    selectedBlock = GameRegistry.getBlock(selectedBlockID);

    // Frame Stuffs
    size(1280, 720, OPENGL);

    if (frame != null) {
      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      URL icon = classLoader.getResource(MainReference.ICON_LOCATION);
      frame.setTitle(MainReference.GAME_NAME);
      frame.setIconImage(getToolkit().getImage(icon));
    }

    frameRate(MainReference.FRAME_RATE);

    addMouseWheelListener(
        new MouseWheelListener() {
          public void mouseWheelMoved(MouseWheelEvent mwe) {
            mouseWheel(mwe.getWheelRotation());
          }
        });
  }
Example #2
0
 public BlockDiamondOre(int id) {
   super(id);
   texture = IconHelper.convertStringToBlockImage("diamondOre.png");
 }