My opinion.
-Code should be written in such a way that you will understand it in a year.
-Code should be written so that it only takes the right amount of resources.
All this repetition 60 times a second of the same actions I do not understand.
-It would also be nice if the code could be extended without redesigning it.
Here is my solution to this problem.
dropmefiles.com.ua/en/mZEfP4c6