예제 #1
0
  private void dologic(float dt) {
    int index = level.step(dt);
    if (index != Level.NONE) {
      boolean ret = HoleManager.getInstance().duuoo(index, level.isOver());
      if (!ret) {
        Log.error("level" + level.data.level + " duuoo failed, index=" + index);
      }
    }

    HoleManager.getInstance().step(dt);
  }
예제 #2
0
  public GameScreen(DdsGame game) {
    Dds.gameScreen = this;
    this.game = game;

    stage = new Stage(new FitViewport(Const.DESIGN_WIDTH, Const.DESIGN_HEIGHT));
    Gdx.input.setInputProcessor(stage);
    skin = new Skin(Gdx.files.internal("uiskin.json"));

    Image img = new Image(new Texture("bg.jpg"));
    stage.addActor(img);

    Table table = new Table();
    //		table.debug();
    stage.addActor(table);
    table.setFillParent(true);

    int n = NUM;
    int w = (Const.DESIGN_HEIGHT - n * Const.PAD_DIST - 2 * Const.EDGE_DIST) / n;
    table.defaults().width(w).height(w).pad(Const.PAD_DIST);

    labelHit = new Label("0", skin);
    labelHit.setAlignment(Align.right);
    stage.addActor(labelHit);

    labelMiss = new Label("0", skin);
    labelHit.setAlignment(Align.left);
    stage.addActor(labelHit);

    LevelData ld =
        LevelManager.getInstance().getLevelData(LevelManager.getInstance().getCurLevel());
    level = new Level(ld);
    HoleManager.getInstance().init(table, level.data.n);
    level.start();
  }