Reversing Random Distribution

Hello Fellow Coders,
Phil Again,
It seems that I have run into another coding predicament…oops.
I have successfully coded a random distribution descending code that changes color when reaching the bottom of the canvas!
Needless to say, I have been bitten by the coding bug (no pun intended).
I was wondering as to how I could reverse this code and have it ascend once it reaches the bottom?
Thank you!
Best,
Phil

Hello Phil, first of all, as you are talking about a bug in your code and asking for advice on tuning it to change its behaviour; it would be easier to answer your question if you published a snippet of your code.

Besides that, I am not sure I understood this

Do you mean you assign colour to pixels according to a function F(y), where y is the pixel’s height? If so, a simple change of variable will do: G(y) = F(height - y). According to what you said:

1 Like

@PhilRandom – I hope that you were able to resolve your issue.

If you are trying to reverse a process that descends so that it ascends, you may be interested in this recent discussion – and in looking at the examples of bouncing balls.