Pygame exercises

Pygame exercises

Postby metulburr » Tue May 21, 2013 2:39 pm

I am not really trying to make a game currently as i feel i am still way too inexperienced in pygame and the process of game programming.

So i was trying to think of ideas of exercises to accomplish small goals to get accustomed to pygame and game programming in general. Ideas from other users to do would be greatful. Mainly exercises that get the point across of one thing in pygame, not this and that going on that would confuse the user of the exercise.
I'll come up with more, but it takes awhile for to think of them, i just figured if i ask the community, then i'll obtain the ideas of an exercise quicker.

So far my pygame exercise list contains:
1) character movement in all 4 directions
2) character movement in all 4 directions and 45 degree directions
3) bouncing a ball back and forth between the edges of the screen
4) animate through the frames of a spritesheet using Surface.subsurface to get each frame
5) rect collision detection
6) mask collision detection
7) create a main menu system
8) using GIMP or the like, create an image, expand its layer to a spritestrip, duplicate the image, and modify each, to make a usable spritesheet
9) make a button, with highlighted color/image when mouse over button
10) make a progress bar

I mean each one seems vital to all games

I was trying to think of exercises to get accustomed to using pygame.font, and working with rects positions on a more basic level, working with alpha layers,
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 1809
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Pygame exercises

Postby Mekire » Wed May 22, 2013 3:30 am

Few things that are a little more advanced:

1) Create an input box that the user can type into. (beginner)
2) Create an arcade style input screen with the alphabet in a box below and a cursor to select letters. (beginner)
3) Create a basic implementation of Conway's Game of Life (intermediate)
4) Create a basic A* algorithm that can solve simple mazes. (intermediate)
5) Use the "depth first search" method to randomly generate a maze. (intermediate)
6) Combine 4 and 5 to generate a random maze and then solve it. (intermediate)
7) Punch a transparent hole in a surface to expose another image. (beginner)
8) Make a basic framework with 3 or more states and a method to change between states. (beginner/intermediate)
9) Experiment with rotating surfaces and moving objects smoothly at angles. (The centers of the rotated objects should not shift). (beginner)
10) Drag an object around the screen. First try centering movement on the mouse and then try using relative mouse movement. (beginner)
11) Create a simple menu that allows you to select from a list of music and change it. (beginner/intermediate)

3,4,5,6 are much more about writing an efficient algorithm than pygame it self; but especially in a language where we must do everything we can to maintain performance, this is very important.

New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1474
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest