Commits

Eric Fredricksen committed 46c320e

Buggily plant some trees

Comments (0)

Files changed (1)

     var x = xi + this.chunkx;
     for (var zi = 0; zi < NZ; ++zi) {
       var z = zi + this.chunkz;
-      if (noise(x/10,9938,z/10) < -0.3) {
+      if (2 * noise(x/10,9938,z/10) + noise(x/1,9938,z/1) < -0.4) {
         var t = topmost(x, z);
         if (t && t.type.plantable)
           t.neighbor(FACE_TOP).type = BLOCK_TYPES.soybeans;
       t.neighbor(FACE_TOP).type = BLOCK_TYPES.flower;
   }
 
+  // Plant some trees
+  for (var n = 0; n < 1; ++n) {
+    var x = this.chunkx + 3 +
+      Math.round(Math.abs(noise(this.chunkx, this.chunkz, n+981.1)) * (NX-6));
+    var z = this.chunkz + 3 +
+      Math.round(Math.abs(noise(this.chunkx, this.chunkz, n+123.4)) *(NZ-6));
+    var t = topmost(x, z);
+    if (t && t.type.plantable)
+      buildTree(t.neighbor(FACE_TOP));
+  }
+
   // Plant some weeds
   for (var n = 0; n < 6; ++n) {
     var x = this.chunkx + 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.