Package iryrwarosh

Examples of iryrwarosh.Tile


     
    });

    Creature creature = world.creature(startX + lookX, startY + lookY);
    Item item = world.item(startX + lookX, startY + lookY);
    Tile tile = world.tile(startX + lookX, startY + lookY);
   
    String text = null;
   
    if (creature != null && player.canSee(creature))
      text = creature.description();
    else if (item != null)
      text = item.name();
    else
      text = tile.description();

    if (text.length() > 78)
      text = text.substring(0, 75) + "...";
   
    terminal.write(text, 1, 23);
View Full Code Here


  }
 
  private void displayTiles(AsciiPanel terminal){
    for (int x = 0; x < screenWidth; x++)
    for (int y = 0; y < screenHeight; y++){
      Tile t = world.tile(x + getScrollX(), y + getScrollY());
      Item item = world.item(x + getScrollX(), y + getScrollY());
     
      if (item == null) {
        terminal.write(
            t.glyph(),
            x, y+1,
            t.color(),
            t.background());
      } else {
        terminal.write(
            item.glyph(),
            x, y+1,
            item.color(),
            t.background());
      }
    }
   
    for (Creature c : world.creatures()){
      int x = c.position.x - getScrollX();
View Full Code Here

    if (Math.random() < 0.25){
      factory.goblin(world);
    } else {
      Tile[] biomes = { Tile.GREEN_TREE1, Tile.BROWN_TREE1, Tile.WHITE_TREE1, Tile.GREEN_TREE1, Tile.BROWN_TREE1,
        Tile.GREEN_ROCK, Tile.BROWN_ROCK, Tile.WHITE_ROCK, Tile.DESERT_SAND1, Tile.WATER1 };
      Tile biome = biomes[(int)(Math.random() * biomes.length)];
      factory.monster(world, biome);
    }
  }
View Full Code Here

  }
 
  private void makeRow(String data, int y) {
   
    for (int x = 0; x < data.length(); x++){
      Tile tile = null;
      switch (data.charAt(x)){
      case '#': tile = wall; break;
      case '~': tile = liquid; break;
      case '.': tile = floor; break;
      case '&': tile = statue; break;
      default : tile = special;
      }
     
      tiles[x][y] = tile.variation(x, y);
    }
   
  }
View Full Code Here

TOP

Related Classes of iryrwarosh.Tile

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.