+ 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

24th Dec 2018, 2:46 PM
Agnese Ghisolfo
Agnese Ghisolfo - avatar
1 ответ
+ 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.
24th Dec 2018, 5:09 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar