示例#1
0
  @Test
  public void shouldSaveCommandAndActAfterTick() {
    shouldBoardWith(new Sapper(2, 2), new Mine(3, 2));

    board.getJoystick().right();

    assertBoard("☼☼☼☼☼\n" + "☼***☼\n" + "☼*☺*☼\n" + "☼***☼\n" + "☼☼☼☼☼\n");

    board.tick();

    assertBoard("☼☼☼☼☼\n" + "☼ 11☼\n" + "☼ 1Ѡ☼\n" + "☼ 11☼\n" + "☼☼☼☼☼\n");

    assertTrue(board.isGameOver());
  }
示例#2
0
 private void moveRight() {
   board.getJoystick().right();
   board.tick();
 }
示例#3
0
 private void moveDown() {
   board.getJoystick().down();
   board.tick();
 }
示例#4
0
 private void unbombLeft() {
   board.getJoystick().act();
   moveLeft();
 }
示例#5
0
 private void unbombDown() {
   board.getJoystick().act();
   moveDown();
 }
示例#6
0
 private void unbombRight() {
   board.getJoystick().act();
   moveRight();
 }
示例#7
0
 private void moveLeft() {
   board.getJoystick().left();
   board.tick();
 }
示例#8
0
 private void unbombUp() {
   board.getJoystick().act();
   moveUp();
 }
示例#9
0
 private void moveUp() {
   board.getJoystick().up();
   board.tick();
 }