Beispiel #1
0
 public static void lookThrough() {
   GL11.glRotatef(game.getPlayerController().getPitch(), 1.0f, 0.0f, 0.0f);
   GL11.glRotatef(game.getPlayerController().getYaw(), 0.0f, 1.0f, 0.0f);
   GL11.glTranslatef(
       game.getPlayerController().getX(),
       game.getPlayerController().getY(),
       game.getPlayerController().getZ());
 }
Beispiel #2
0
 public static void renderScene() {
   game.render();
   GL11.glColor3f(0.5f, 0.5f, 1.0f);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
   Render.renderArray(world.getSpawn());
   GL11.glLoadIdentity();
   Display.update();
 }
Beispiel #3
0
  public static void tick() {
    // Mouse.setCursorPosition(Display.getWidth()/2, Display.getHeight()/2);
    if (Display.isCreated()) {
      if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
        exit = true;
      }
      if (Keyboard.isKeyDown(Keyboard.KEY_R)) {
        Mouse.setGrabbed(false);
      }
      if (Mouse.isButtonDown(0)) {
        Mouse.setGrabbed(true);
      }

      Display.update();
      if (Display.isCloseRequested() || exit) {
        game.close();
        Display.destroy();
      }
    }
    for (int i = 0; i < world.entities.size(); i++) {
      world.entities.get(i).onTick();
    }
  }