-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[examples] Added shapes_recursive_tree
#5229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
shapes_recursive_tree
shapes_recursive_tree
shapes_recursive_tree
Vector2 initialEnd = CalculateBranchEnd(start, 0.0f, length); | ||
branches[count++] = (Branch){start, initialEnd, 0.0f, length}; | ||
|
||
for (int i = 0; i < count; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
||
float nextLength = branch.length * branchDecay; | ||
|
||
if (count < maxBranches && nextLength >= 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
||
ClearBackground(RAYWHITE); | ||
|
||
for (int i = 0; i < count; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review it to follow raylib code conventions with aligned brackets?
return 0; | ||
} | ||
|
||
static Vector2 CalculateBranchEnd(Vector2 start, float angle, float length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - shapes recursive tree"); | ||
|
||
Vector2 start = { (screenWidth / 2.0f) - 125, screenHeight }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review to follow raylib code conventions?
{ | ||
// Update | ||
//---------------------------------------------------------------------------------- | ||
float theta = angle * DEG2RAD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review to follow raylib code conventions?
|
||
static Vector2 CalculateBranchEnd(Vector2 start, float angle, float length) { | ||
return (Vector2){ | ||
start.x + length * sinf(angle), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, could you review to follow raylib code conventions?
@Jopestpe Looks very good, just reviewed some minor format tweaks, to follow raylib code conventions. Thanks! |
I think nothing will escape the conventions now 😅 |
@Jopestpe great! thanks! 👍😄 |
Description
Changelog
Tested and compiles successfully on Linux
