Package org.jpacman.framework.model

Examples of org.jpacman.framework.model.Sprite


  /**
   * Test what happens if there are multiple sprites on one tile.
   */
  @Test
  public void multipleSprites() {
        Sprite david = new Sprite() {
        };
    david.occupy(center);

    // now David is the top most sprite.
    assertThat(center.topSprite(), equalTo(david));

    // but john is still there too.
View Full Code Here


   * @param y y-axis
   * @throws FactoryException if the code is illegal.
   */
  protected void addSprite(char spriteCode, int x, int y) throws FactoryException {
    assert theBoard != null : "Empty board: (" + x + ", " + y + ")->" + spriteCode;
    Sprite theSprite = getSprite(spriteCode);
    if (theSprite != null) {
      theBoard.put(theSprite, x, y);
    }
  }
View Full Code Here

   * @param spriteCode the char representing a sprite type
   * @return a new sprite object.
   * @throws FactoryException if the char can't be handled.
   */
  protected Sprite getSprite(char spriteCode) throws FactoryException {
    Sprite theSprite = null;
    switch (spriteCode) {
    case PLAYER:
      theSprite = factory.makePlayer();
      break;
    case GHOST:
View Full Code Here

TOP

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

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.