Damn.... i just wrote a whole post here and accidentally deleted it all before posting. I dont really want to spend another 20 minutes rewriting that again...sorry.
quick rundown:
A) There are a few bottlenecks. In each while loop you have render font that is static text unnecessarily.
B) You should avoid nested while loops to implement game states as it causes spaghetti code and camouflage bugs. Its more sane to create a state machine to organize your code.
C) Are you intending on it moving on a block by block basis or per pixel? Just saw that you shrunk FPS drastically
D) You can use github for sharing programs with resources.
E) Always set your FPS to 60. Do not reduce that to reduce speed. If you need to reduce its speed movement then you need to use time. The first example does this but you dont want every second, probably every millisecond, and "do something" is move. In your case you are going to up your FPS to 60 and slow the snake down to whatever you want. The longer delay, the slower it goes. Aside form that you can also do delta time movement.
You would also make it a lot easier on yourself and others if you used classes. For example the snake should be a class, with all its drawing in it, logic in it, data in it, collisions in it, etc.
quick rundown:
A) There are a few bottlenecks. In each while loop you have render font that is static text unnecessarily.
B) You should avoid nested while loops to implement game states as it causes spaghetti code and camouflage bugs. Its more sane to create a state machine to organize your code.
C) Are you intending on it moving on a block by block basis or per pixel? Just saw that you shrunk FPS drastically
D) You can use github for sharing programs with resources.
E) Always set your FPS to 60. Do not reduce that to reduce speed. If you need to reduce its speed movement then you need to use time. The first example does this but you dont want every second, probably every millisecond, and "do something" is move. In your case you are going to up your FPS to 60 and slow the snake down to whatever you want. The longer delay, the slower it goes. Aside form that you can also do delta time movement.
You would also make it a lot easier on yourself and others if you used classes. For example the snake should be a class, with all its drawing in it, logic in it, data in it, collisions in it, etc.
Recommended Tutorials: