Ejemplo n.º 1
0
 public void update() {
   triggerHandler.update();
   player.update(map);
   camera.update(player.GetPosX(), player.GetPosY());
   map.update(camera);
   highScore.update(camera);
   updatePlayerFallDeath();
 }
Ejemplo n.º 2
0
 public void draw(Graphics g) {
   g.fillRect(0, 0, WIDTH, HEIGHT);
   DrawBackGround(g);
   g.translate(camera.pos_x, camera.pos_y);
   // g.translate(0,0);
   map.draw(g);
   player.draw(g);
   highScore.draw(g);
   g.dispose();
 }
Ejemplo n.º 3
0
 private void load(String path) throws FileNotFoundException, IOException, ClassNotFoundException {
   this.path = path;
   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path));
   Editor editor = (Editor) ois.readObject();
   map = new Map(editor.getMap(), false);
   triggerHandler = new TriggerHandler(this, map.getTriggerEntityManager());
   player = new Player(inputHandler);
   player.setLocation(editor.GetPlayerLocation());
   camera.pos_y = 0;
   ois.close();
   start();
 }