How to add high Score in this snake pygame? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to add high Score in this snake pygame?

https://code.sololearn.com/c6Y5H2x59Mxd/?ref=app

1st Sep 2021, 4:58 PM
Nafi Rahat Rahman
2 Answers
+ 1
save current score into some highscore.txt file. every time you start the game. load that txt file. at the end of the game. compare current score with the highscore.txt. if it higher, override that highscore.txt with current score. Hope this helpful.
1st Sep 2021, 5:39 PM
Shahrull Fytri
Shahrull Fytri - avatar
0
okk
7th Dec 2022, 8:34 AM
Mpho Mahaula
Mpho Mahaula - avatar