Package org.jpacman.framework.model

Examples of org.jpacman.framework.model.Player


   * @throws FactoryException Never.
   */
  @Test
  public void testC3_PlayerMovesToGhost() throws FactoryException {   
    Game g = makePlay("PG#");
    Player p = g.getPlayer();
   
    g.movePlayer(Direction.RIGHT);
   
    assertFalse("Move kills player", p.isAlive());   
    assertThat(tileAt(g, 1, 0), equalTo(p.getTile()));
  }
View Full Code Here


   */
  @Test
  public void testC5_PlayerMovesToFood() throws FactoryException {   
    Game game = makePlay("P.#");
    Food food = (Food) game.getBoard().spriteAt(1, 0);
    Player player = game.getPlayer();

    game.movePlayer(Direction.RIGHT);
   
    Tile newTile = tileAt(game, 1, 0);
    assertEquals("Food added", food.getPoints(), player.getPoints());
    assertEquals("Player moved", newTile.topSprite(), player);
    assertFalse("Food gone", newTile.containsSprite(food));
  }
View Full Code Here

  }
 
  @Override
  public Player makePlayer() {
    assert getGame() != null;
    Player p = new Player();
    getGame().addPlayer(p);
    return p;
  }
View Full Code Here

TOP

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

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.