Introduction - If you have any usage issues, please Google them yourself
First empty the canvas with the background color, and then draw the food, followed by the for loop Snake snake block painting on canvas in order to achieve gaming effects.
C# implementation of the reference value.