Snakes Pygame: Difference between revisions

imported>Jesstess
imported>Jesstess
So far, the snake can only move up or down. Fix this by completing the "Handle the remaining movement keys" TODO in the <code>move</code> method of the <code>Snake</code> class. Test your changes by re-running the game and moving your snake left and right.
 
=== 3. SetGive athe keygame a repeatbetter speedbackground ===
 
The game has a pretty boring solid color background. Spice it up by adding a background image. We've provided a sample background file call <code>leaves.jpg</code> in the Snakes directory, but create and add your own if you want!
 
Use [http://www.pygame.org/docs/ref/image.html#pygame.image.load pygame.image.load] to load the background. You'll need to re-display the background on every tick of the game, just like we currently do with the solid color using <code>game_surface.fill(BACKGROUND_COLOR)</code>.
 
=== 4. Set a key repeat speed ===
 
So far, you have to press an arrow key for each movement of the snake. Wouldn't it be convenient to be able to just hold down an arrow key to keep moving our snake?
Test your changes by re-running the game and holding down the arrow key while moving your snake around.
 
=== 45. Handle quit and restart key presses ===
 
I want to keep playing! So far, there's no way to quit (besides closing the window) or restart the game.