Package com.mojang.ld22.level.tile

Examples of com.mojang.ld22.level.tile.FlowerTile


    if (shape == 0) screen.render(x * 16 + 8, y * 16 + 8, 1 + 1 * 32, flowerCol, 0);
  }

  public boolean interact(Level level, int x, int y, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.shovel) {
        if (player.payStamina(4 - tool.level)) {
          level.add(new ItemEntity(new ResourceItem(Resource.flower), x * 16 + random.nextInt(10) + 3, y * 16 + random.nextInt(10) + 3));
          level.add(new ItemEntity(new ResourceItem(Resource.flower), x * 16 + random.nextInt(10) + 3, y * 16 + random.nextInt(10) + 3));
          level.setTile(x, y, Tile.grass, 0);
View Full Code Here


    screen.render(x * 16 + 8, y * 16 + 8, 2 + 32, col, 1);
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.shovel) {
        if (player.payStamina(4 - tool.level)) {
          level.setTile(xt, yt, Tile.dirt, 0);
          return true;
        }
View Full Code Here

    hurt(level, x, y, dmg);
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.axe) {
        if (player.payStamina(4 - tool.level)) {
          hurt(level, xt, yt, random.nextInt(10) + (tool.level) * 5 + 10);
          return true;
        }
View Full Code Here

    }
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.shovel) {
        if (player.payStamina(4 - tool.level)) {
          level.setTile(xt, yt, Tile.dirt, 0);
          level.add(new ItemEntity(new ResourceItem(Resource.sand), xt * 16 + random.nextInt(10) + 3, yt * 16 + random.nextInt(10) + 3));
          return true;
View Full Code Here

    hurt(level, x, y, 0);
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.pickaxe && tool.level == 4) {
        if (player.payStamina(4 - tool.level)) {
          hurt(level, xt, yt, random.nextInt(10) + (tool.level) * 5 + 10);
          return true;
        }
View Full Code Here

    hurt(level, x, y, 0);
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.pickaxe) {
        if (player.payStamina(6 - tool.level)) {
          hurt(level, xt, yt, 1);
          return true;
        }
View Full Code Here

    return true;
  }

  public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
    if (item instanceof ToolItem) {
      ToolItem tool = (ToolItem) item;
      if (tool.type == ToolType.shovel) {
        if (player.payStamina(5)) {
          // level.setTile(xt, yt, Tile.infiniteFall, 0);
          int count = random.nextInt(2) + 1;
          for (int i = 0; i < count; i++) {
View Full Code Here

    hasWon = false;

    levels = new Level[5];
    currentLevel = 3;

    levels[4] = new Level(128, 128, 1, null);
    levels[3] = new Level(128, 128, 0, levels[4]);
    levels[2] = new Level(128, 128, -1, levels[3]);
    levels[1] = new Level(128, 128, -2, levels[2]);
    levels[0] = new Level(128, 128, -3, levels[1]);

    level = levels[currentLevel];
    player = new Player(this, input);
    player.findStartPos(level);
View Full Code Here

  public void tick() {
    super.tick();

    if (invulnerableTime > 0) invulnerableTime--;
    Tile onTile = level.getTile(x >> 4, y >> 4);
    if (onTile == Tile.stairsDown || onTile == Tile.stairsUp) {
      if (onStairDelay == 0) {
        changeLevel((onTile == Tile.stairsUp) ? 1 : -1);
        onStairDelay = 10;
        return;
View Full Code Here

    }
    return super.move(xa, ya);
  }

  protected boolean isSwimming() {
    Tile tile = level.getTile(x >> 4, y >> 4);
    return tile == Tile.water || tile == Tile.lava;
  }
View Full Code Here

TOP

Related Classes of com.mojang.ld22.level.tile.FlowerTile

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.