Beispiel #1
0
  /** @param main the main class of game */
  public Menu(Main main) {
    super(main);
    this.main = main;

    setBackground(main.getResources().getDrawable(R.drawable.background));
    setGravity(Gravity.CENTER);

    MenuItem playBtn =
        new MenuItem(main, this, Main.scrW / 3, Main.scrH / 5, main.getString(R.string.play));

    addView(playBtn);
  }
Beispiel #2
0
  /** the MenuItem has been clicked */
  void onClick(final View v) {
    Main.playSnd(0);

    main.newGame(Game.HEG_NEWGAME);
  }