Esempio n. 1
0
 public void victory() {
   victory.setPosition(
       -victory.getWidth() / 2 + Gdx.graphics.getWidth() / 2,
       -victory.getHeight() / 2 + 50 * HW4.SCALE + Gdx.graphics.getHeight() / 2);
   gameEnd.begin();
   victory.draw(gameEnd);
   gameEnd.end();
   if (rs.getStage() == null) stage.addActor(rs);
 }
Esempio n. 2
0
 public void update() {
   gcl = new ArrayList<GhostComponent>();
   if (SelectionManager._instance.singleSelected != null) {
     BuildingComponent bc = sm.singleSelected.getComponent(BuildingComponent.class);
     GhostComponent gc = sm.singleSelected.getComponent(GhostComponent.class);
     if (bc != null && bc.bc.playerControlled) {
       if (bp.getStage() == null) {
         stage.clear();
         stage.addActor(bp);
       }
     } else if (gc != null && gc.bc.playerControlled) {
       gcl.add(gc);
       if (gp.getStage() == null) {
         stage.clear();
         stage.addActor(gp);
       }
     }
   } else if (SelectionManager._instance.selected.size() > 0) {
     for (Entity e : sm.selected) {
       GhostComponent gc = e.getComponent(GhostComponent.class);
       if (gc != null) gcl.add(gc);
     }
     if (gp.getStage() == null) {
       stage.clear();
       stage.addActor(gp);
     }
   } else if (!HW4.stop) {
     if (rs.getStage() == null || !display) stage.clear();
   }
   f.setText("Souls: " + GhostComponent.money);
   if (cw.getStage() == null) stage.addActor(cw);
   if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE)) {
     display = !display;
   }
   if ((HW4.win || display) && rs.getStage() == null) {
     stage.addActor(rs);
   }
 }
Esempio n. 3
0
 public void defeat() {
   if (rs.getStage() == null) stage.addActor(rs);
 }