diff --git a/main.cpp b/main.cpp index 71407be..3fdbfaf 100644 --- a/main.cpp +++ b/main.cpp @@ -27,6 +27,7 @@ struct branch { Color color; uint8_t numOfBranches; + float lenghthRatio; }; struct draw_args @@ -68,7 +69,7 @@ void draw_branch(draw_args arg) Vector2 next = draw_line(arg.start, arg.angleDeg, arg.lenghth, arg.dep); - float next_len = 0.7f; + float next_len = tree[arg.dep].lenghthRatio; float sectors = tree[arg.dep].numOfBranches + 1; float degres = 180.0f / sectors; @@ -100,6 +101,8 @@ void generate_tree() tree[i].color = (Color){r, g, b, 255}; tree[i].numOfBranches = GetRandomValue(1, 3); + + tree[i].lenghthRatio = ((float)GetRandomValue(600,700)) / 1000.0f; } tree[0].color = tree[1].color;