-
Posts
3,459 -
Joined
-
Last visited
Rikifive's Achievements
Single Status Update
-
So I've made this...
I took me way longer than I expected, because... I'm 99% sure, that I'm making things necessarily more complicated than they should...
I mean, I could manually program how they should move- set the delays/speed based on their distance from the center, thus have full control on every pixel on their way, as simple as that, but no... I wanted to make it automatic and fit it into one line of code*... To do that, I had to come up with a formula, that raises towards the center and goes near 0 on the edges. ...And guess what... As soon as I started thinking of a possible formula, quadratic functions were the thing that came to my mind.
>>> Putting into game...
* - the one line of code mentioned before refers to the part highlighted in blue. The manual way I've mentioned would require multiple lines of code with another if statements and such.Hah, I think it's actually the very first time in my entire life, where I had some use of the quadratic functions besides school.
I kept asking teachers why do I need all of that stuff in my life - never got a satisfying answer.. But it seems, that I'm slowly figuring that out by myself.