예제 #1
0
  public void update() {
    String scene = gm.getScene();
    status.setText(scene);
    response.setText(gm.getPl_res());
    ch = gm.getChoices();
    if (gm.getBattle()) {
      /*data = gm.getEn();
      if (data == null )
      {
      	Log.d(TAG, "no data");
      }
      else
      { */
      status.setText(scene);
      response.setText(gm.getPl_res());
      b1.setText("Attack");
      b2.setText("Defend");
      b3.setText("Flee");
      b4.setText("Skills");

    } else if (gm.isOver()) {
      Log.d(TAG, "Game over");
      Intent over = new Intent(StartGame.this, GameOver.class);
      startActivity(over);
      this.finish();
    } else {
      b1.setText(ch[0]);
      b2.setText(ch[1]);
      b3.setText(ch[2]);
      b4.setText(ch[3]);
    }
  }
예제 #2
0
  public void script() {
    gm = new GameScript(pl);

    status.setText(gm.getScene());
    response.setText(gm.getPl_res());
    ch = gm.getChoices();

    b1.setText(ch[0]);
    b2.setText(ch[1]);
    b3.setText(ch[2]);
    b4.setText(ch[3]);
    gm.setRunning(true);
    gm.start();
  }