Install Python 2.7 and Pygame 1.9. Make sure you get the right versions. Mac? Windows? 64-bit? 32-bit? etc
- http://www.pygame.org/ The pygame site where you can download everything you need
- https://inventwithpython.com/ A couple of online tutorial books that you can work from
Basic tasks to start with
- Get the Pygame screen to appear.
- Get a small image to appear.
- Make it move.
- Make it responds to mouse clicks.
Only now can you begin to think about games.
A basic game loop:
- Processing user input will use the pygame.event module.
- Updating the game world will almost certainly be a nested loop to run through each sprite to get them to react to the current game state. Pygame allows you to group similar sprites and call their update() methods. If you don’t use a pygame.sprite.Group then you will almost certainly keep multiple sprites of the same type in a list and run through the list:
for enemy in enemiesList: enemy.update()
- Rendering the game world will involve making calls to the Pygame objects’ draw() methods.
Other obvious functions you might program are:
- gameOver(): Checks to see if a game over state has been reached and returns true if it has, false otherwise.
- changeScore(): Keeps the score up-to-date.