Package Engine.Blocks

Examples of Engine.Blocks.Air


  public void Generate(int seed, int cx, Random random) {
    this.seed = seed;
    for (int y = 0; y < TerrainHeight; y++) {
      // XReihe Durchgehen
      for (int x = 0; x < TerrainWidth; x++) {
        blocks[y][x] = new Air();
        if (y == TerrainHeight)
          blocks[y][x] = new Bedrock();
      }
    }
    // for (int y = 0; y < TerrainHeight; y++) {
    // XReihe Durchgehen
    for (int x = 0; x < TerrainWidth; x++) {
      // Sys.alert("Pos", "X:"+x+" Y: "+y +
      // " BLocks: "+blocks.length);
      /*
       * if (y > TerrainHeight - 10+(5*Math.sin(x/seed))) { blocks[y][x] =
       * new Dirt(); } if (y == (int)(TerrainHeight
       * -10+(5*Math.sin(x/seed)))) {
       *
       * }
       */
      for (int y = TerrainHeight - 2; y > GetTerrainHeight(x + (cx * 16)); y--) {
        blocks[y][x] = new Dirt();
      }
      for (int y = TerrainHeight - 2; y > GetTerrainHeight(x + (cx * 16))
          + 4 + random.nextInt(2); y--) {
        if (y >= 0)
          blocks[y][x] = new Stone();
      }
      for (int y = TerrainHeight - 2; y > TerrainHeight - 15; y--) {
        if (y >= 0)
          if (blocks[y][x].ID() == (new Air()).ID())
            blocks[y][x] = new Water();
      }
      blocks[GetTerrainHeight(x + (cx * 16))][x] = new Gras();

    }
View Full Code Here


      // System.out.println(blocks[Y][X].ID());
      return blocks[Y][X];

    } catch (Exception ex) {
      // System.out.println("No in Terrain Physic: X: " + X + " Y: " + Y);
      return new Air();
    }

  }
View Full Code Here

TOP

Related Classes of Engine.Blocks.Air

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.