Black Screen of Death (Why?)

So I made this code

This is supposed to be a simulation of trees. A seed falls to the ground and it generates a tree trunk that starts growing. But after a while I get a black screen. Why is this code cursed?

Hi,
I don’t exactly know, but you create an instance of object treeTrunck inside a loop that go through all instances of object treeTrunck…

And you only Start the timer from 0 for one instance (the new created one I suppose)
So maybe at every frame a new instance is created, and that’s not what you want

So maybe add a Start timer action before the creating treeTrunck action.

1 Like

yes correct I just realized how dumb my code is. I created a new object that follows the treeTrunk and that doesn’t loop.

Sorry guys I am making such dumb mistakes and posting them, I think I haven’t had enough rest this week

2 Likes

Hello,
the object timer check all istances each frame, so it isn’t necessary put the timer check into “for all instances”

The block above is ok because you delete the seed so the collision should be satisfy only one time.

Bye,
J

No no, not dumb, loops can be very tricky!

Loops and the number of instances can get out of control quickly. Either on screen or off screen. This is what happened while I was trying to see if I could recreate Donkey Kong.

ScreenRecorderProject25_1

1 Like