Package org.jpacman.framework.model

Examples of org.jpacman.framework.model.Board


   * @throws FactoryException If parsing fails. Should not happen.
   */
  @Test
  public void testFullMap() throws FactoryException {
    Game g = parser.parseMap(map);
    Board b = g.getBoard();

    // did we recognize the right sprites?
    assertEquals(SpriteType.EMPTY, b.spriteTypeAt(1, 3));
    assertEquals(SpriteType.PLAYER, b.spriteTypeAt(2, 2));
    assertEquals(SpriteType.GHOST, b.spriteTypeAt(1, 2));
    assertEquals(SpriteType.WALL, b.spriteTypeAt(0, 0));
    assertEquals(SpriteType.FOOD, b.spriteTypeAt(1, 1));

    // did we properly set the player?
    assertEquals(g.getPlayer(), b.spriteAt(2, 2));

    // were all ghosts added?
    assertEquals(2, g.getGhosts().size());

    // was the food actually added?
View Full Code Here


    startx = x;
    starty = y;
    dir = d;
    nextx = nx;
    nexty = ny;
    board = new Board(WIDTH, HEIGHT);
  }
View Full Code Here

  }

  @Override
  public Board makeBoard(int w, int h) {
    assert getGame() != null;
    Board b = new Board(w, h);
    getGame().setBoard(b);
    return b;
  }
View Full Code Here

TOP

Related Classes of org.jpacman.framework.model.Board

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.