Skip to main content
added 172 characters in body
Source Link

You store the current depth of every branch for each node, and append Rendertree to render all nodes up to a specific depth, given as a parameter.

This way, you can show each depth level seperatly.

Pseudocode could be like this:

Generate tree

While(GameLoopRunning)
  begin
    for i := 0 to maxdepth do
      begin
        RenderTree(trunk, i)
        delay(250); //should not be like this, will block entire game loop.         
      end
  end

Edit: You might want to use some kind of timer to fire some kind of GrowNow!-Events to your game logic in order to avoid the for-loop and delay in your main game loop.

You store the current depth of every branch for each node, and append Rendertree to render all nodes up to a specific depth, given as a parameter.

This way, you can show each depth level seperatly.

Pseudocode could be like this:

Generate tree

While(GameLoopRunning)
  begin
    for i := 0 to maxdepth do
      begin
        RenderTree(trunk, i)
        delay(250); //should not be like this, will block entire game loop.         
      end
  end

You store the current depth of every branch for each node, and append Rendertree to render all nodes up to a specific depth, given as a parameter.

This way, you can show each depth level seperatly.

Pseudocode could be like this:

Generate tree

While(GameLoopRunning)
  begin
    for i := 0 to maxdepth do
      begin
        RenderTree(trunk, i)
        delay(250); //should not be like this, will block entire game loop.         
      end
  end

Edit: You might want to use some kind of timer to fire some kind of GrowNow!-Events to your game logic in order to avoid the for-loop and delay in your main game loop.

Source Link

You store the current depth of every branch for each node, and append Rendertree to render all nodes up to a specific depth, given as a parameter.

This way, you can show each depth level seperatly.

Pseudocode could be like this:

Generate tree

While(GameLoopRunning)
  begin
    for i := 0 to maxdepth do
      begin
        RenderTree(trunk, i)
        delay(250); //should not be like this, will block entire game loop.         
      end
  end