There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
You may wish to look into background(p1, p2) in the function draw().
p1 specifies a value between white and black whereas p2 specifies opacity of the background relative to current colour range (default is 0-255). The smaller the p2 value, the clearer the trail behind.
The reason for this is, when the draw() function is called on every frame, the new frame with a new background colour will be placed on the old frame. If the background consists an alpha value, a semi-transparent frame will be placed on top of the previous frame. That’s why we can see the previous positions of the object.
You may try to change the value of p2 and see how the echoes change.
And I’m wondering, why are these circles remaining?
I mean, in previous lessons, the shapes are re-rendered in each draw looping. However, in this random lesson circles rendered are remaining and new circle are generated on old ones.
Why does this happen? If anybody know, please teach me. Thank you.
Sorry, I found the reason.
It’s natural that old circles remain . Because as [csswhiz46367] said above, new frame is rendered on old one.
So to draw animation on the canvas, previous lessons call background(0); in each draw() loop so that the canvas looks fresh.
I was silly but I keep this post for someone’s information.