Chapter 8. pygame

In the previous chapter, we got to use every skill we learned in the book to create a simple, two-player guessing game. In this chapter, you will learn about pygame modules and how they work to make game creation possible using Python.

What is pygame?

As stated on the most current pygame website, http://www.pygame.org/hifi.html, pygame is a set of Python modules designed for writing games. pygame, like Python, is free and open source, meaning that it can be used for free and shared with others. The developers of pygame have made sure that it is compatible with several different graphics display engines, so this means that the games developed using pygame could be played in a variety of environments. Installing pygame is a careful process, and you may need the help of your parents or another adult since there are a few steps. We will discuss the installation for Windows, Mac, and Linux in the next section of the chapter.

pygame is quite popular, and the website is undergoing revisions at the time of writing this. Sometimes, you will see an older part of the site, while other times, you will see a new part of the site. New parts of the pygame website look like this:

What is pygame?

Meanwhile, older parts of the pygame website have a green background, as follows:

What is pygame?

You can always use the search bar on either part of the website to locate information that you need.

Once you've installed pygame, you will learn about the features of pygame that will be the most useful for our final project, in Chapter 9, Tiny Tennis. Since this is our first game using visuals, we will not use all of the features offered by pygame in our first project. We will use most of the basic features that are required to make an interactive, two-player game. However, once you feel ready, you are encouraged to look at the pygame website (http://www.pygame.org/hifi.html), the pygame documentation (available in your installation of pygame as well as on the website), and the more advanced pygame book published by Packt Publishing, Instant Pygame for Python Game Development How-to, Ivan Idris, to gain a better understanding of the more complex tools that pygame offers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.127.141