+ 1
Help me !!
I want to rewrite snake but I have some problems with the code . The problems are that the screen continue to refresh and that the tail doesn’t follow the head. https://code.sololearn.com/co37OntiMj6F/?ref=app
1 Réponse
+ 4
The problem is with the following line in the Draw() function:
if ( tailX[k]== j && tailY[x]== i)
It should be tailY[k] instead of tailY[x]. Then it will work as expected.
You can make the code more simpler to use and extend by using classes.