Snakes Pygame: Difference between revisions

imported>Jesstess
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1:
[[File:gridsnakes.png|right|300px]]
 
== Project ==
Line 7:
== Goals ==
 
* practicelearn about using graphics and sounds to create interactive games using the Pygame library
* practice usingreading anand eventunderstanding loopsomeone toelse's make action happencode
 
== Project setup ==
Line 71:
 
Test your changes by re-running the game, running into the bad snake to end the game, and making sure you can restart.
 
 
==Bonus exercises==
 
=== 1. Play a sound when you eat food ===
 
We've included <code>ding.ogg</code> as a sample sound, but find and add your own if you want!
 
Test your changes by re-running the game with the sound on and observing that a noise is played when the snake eats pieces of food.
 
=== 2. Give yourself multiple lives ===
 
Typically in games you have multiple lives available. Give your snake 3 lives to start with, lose a life each time you run into yourself or the bad snake, and display how many lives remain in the upper left corner.
 
You may find it convenient to create a new file with a new class called <code>Lives</code> that keeps track of this game state and the work of updating the display.
 
 
===Congratulations!===
 
You've read, modified, and improved a game using Pygame that uses images and sound and game concepts like an event loop and managing keypresses. Keep practicing!
 
[[File:Fireworks.png|150px]]
[[File:Balloons.png|150px]]
Anonymous user