From 107d4a797d0d34aa0322a5659062b504a3a96f73 Mon Sep 17 00:00:00 2001 From: Fr3deric Date: Sat, 9 Mar 2019 22:21:07 +0100 Subject: [PATCH] add a little slope to some trees --- baumgen.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/baumgen.js b/baumgen.js index 0475e78..974969e 100644 --- a/baumgen.js +++ b/baumgen.js @@ -27,7 +27,10 @@ function gen_tree(pos, maxheight) { ); } - baum.angle = Math.PI / 2; // + Math.random() * 0.2 - 0.1; + baum.angle = Math.PI / 2; + if(Math.random() < 0.3) { + baum.angle += Math.random() * 0.2 - 0.1; + } if((baum.crown.shape != "triangle") && (Math.random() < 0.5)) { var b = {