Пример #1
0
 public void render() {
   glPushMatrix();
   {
     glClearColor(0, 0, 0, 0);
     glColor4f(255, 255, 255, 255);
     tileMap.render();
     player.render(tileMap.getX(), tileMap.getY());
     chat.render();
     robot.render();
   }
   glPopMatrix();
 }
Пример #2
0
 public Game() {
   sems = new Semaphore[2];
   for (int i = 0; i < 2; i++) {
     sems[i] = new Semaphore(1);
   }
   chat = new ChatHandler(0, 720 - 32, 14, 6);
   tileMap = new TileMap("testMap.txt", 32, sems);
   player = new Player(tileMap, tileMap.getPlayerSpawnX(), tileMap.getPlayerSpawnY(), chat);
   robot =
       new Robot(
           "Resources/Textures/NPCs/Enemies/Test",
           tileMap.getPlayerSpawnX(),
           tileMap.getPlayerSpawnY() - 10,
           "bob",
           player,
           tileMap,
           chat,
           sems);
 }
Пример #3
0
 public void update() {
   chat.update();
   player.update();
   tileMap.update((1280 / 2) - (int) player.getX(), (720 / 2) - (int) player.getY());
   robot.update();
 }