Customer Reviews: Making Games with Python & Pygame
Your Garage botysf16 Amazon Fashion Learn more Discover it Adele Fire TV Stick Subscribe & Save Patriotic Picks Shop-by-Room Amazon Cash Back Offer WienerDog WienerDog WienerDog  Amazon Echo  Echo Dot  Amazon Tap  Echo Dot  Amazon Tap  Amazon Echo Introducing new colors All-New Kindle Oasis AutoRip in CDs & Vinyl Segway miniPro STEM

Customer Reviews

4.8 out of 5 stars66
Format: Paperback|Change
Price:$18.52+ Free shipping with Amazon Prime
Your rating(Clear)Rate this item

There was a problem filtering reviews right now. Please try again later.

"Making Games with Python and Pygame" is the second in a series of tutorial books from Al Sweigart. Knowing that it can often be a somewhat tedious affair, Sweigart takes the approach that it's easier to learn a new computer language if it's applied to something fun. His first book, "Invent Your Own Computer Games with Python", put this to great effect as it lead the reader through learning basic Python by creating several small and simple games. His latest book continues this concept with more complex games and introduces the Pygame library for manipulating graphics, animation and sound. Well, re-introduces Pygame. The "Invent" book had a chapter on Pygame but it really needs its own book, hence this one.

"Making Games with Python and Pygame" is divided up into ten chapters. Over the course of the book, you will learn to create twelve games and every one of them is fun and very useful in the concepts that they teach. Make no mistake, this is not a book on basic Python syntax or just using the Pygame library. This book teaches you how to make actual games with a nice level of "professional" touches. I was surprised by a number of the hidden gems that were included in the book.

Each chapter follows the same basic formula. First is a brief description of the game that will be created and how it works. Next, is the full source code for the game. Then, he goes through the code, section by section, with a thorough explanation of what the code does and why it does it. At the end of the chapter, is often ideas for expanding the game and a link to "buggy" versions of the game that you can use to practice debugging techniques. The buggy versions can all be downloaded and each version tells you exactly what is wrong with the code. In fact, the book makes several references to supplemental material to be found on the book's website.

One thing about the chapters that I really appreciated was the way that they are organized. Each section of code has its own subchapter heading. This makes it very easy to find information on that section or, more importantly, the concept that section represents. These subchapters are also incorporated into the main table of contents. Another really great idea is that the book's website includes a "diff" tool where you can compare the source code that you typed in to the actual code for the games. This is extremely helpful if you get stuck on a bug and can't figure out what you did differently from the code itself. Combine this with the "buggy" versions available online and you can learn a lot. For example, comparing the working source code to a version where the game character isn't displayed on the screen as expected. This is the first time that I've seen this concept applied and it's a wonderful tool.

Here is a quick breakdown of the chapters and the topics that they cover:

Chapter 1 introduces you to the intent of the book and a few other preliminaries such as getting Python and Pygame installed.

Chapter 2 covers the basics of the game loop, game states, and general concepts such as managing the screen, graphic surfaces (canvases), basic drawing, animation and sound manipulation, and more. It also explains how to manage how fast the screen is drawn (refresh rates and frames per second). These are all very important ideas to understand before you can tackle the games themselves and Sweigart does an excellent job of leading you through them.

Chapter 3 introduces you to your first game, the classic "Memory" puzzle. The purpose of this chapter is to give you some experience with a real game loop and refresh you on your basic Python (conditions, loops, etc), as well as coordinate systems. It also introduces you to some nice additional features - basic animations for starting and ending the game.

Chapter 4 has you creating a Sliding Numbers puzzle. Key concepts such as keyboard and mouse input, screen rendering and animation are used here. I really want to emphasize something that is introduced in this chapter: "flair". Most beginner books that describe how to make games just teach you the basic mechanics of the game itself. Several of the chapters in this book teach you how to add some nice flair to your games. Chapter 4 has you create a nice little animation when the game is restarted. Rather than simply redrawing the board in a reset state, it has you play back every move in reverse, so it looks like the puzzle is being unshuffled. It might sound like a small thing but it helps to add a level of "professionalism" to the game. Especially for a beginner, it helps to give them the feeling that they have created something special. Little touches like this are spread throughout the remaining chapters.

Chapter 5 is built around a Simon-type (copy me) game. For those that may not remember Simon, its an electronic game that has four large buttons, each a different color, that light up and play a sound in sequence. The player then has to push each button in the same sequence. The longer you play, the longer the sequences get. This chapter focuses on the use of sound and controlling it, as well as using time as a feature. It also focuses on a bit of flair called an "attractor". An attractor is often used when a game is sitting idle. This is very common in arcade coin-op games where they will play an animation or sound clip to get your attention. You'll also see it used in games where you control a character on-screen (a la Mario Brothers or Braid) and let them sit idle for a bit and they start to get "bored". They'll start tapping their toes or looking around, maybe whistle... Those actions are all possible with the attractor logic and "idle state" taught in this chapter.

Chapter 6 uses the classic Snake game, here called "Wormy", to teach simple collision detection and mapping concepts. While not explicitly stated in the chapter, his approach to tracking the snake on the playing field and rendering it is very similar to managing levels and drawing their maps onscreen in RPGs. This concept is expanded on later in Chapter 9. Text rotation is also introduced for the title screen.

Chapter 7 expands on what has been learned so far with a Tetris clone. Here we're getting into complex shape manipulation, variable timing for user movements, more collision and rotation techniques and UI layout. A critical element of this chapter's game is that it is played in real time. Anyone that has played Tetris will be all to familiar with how frantic things can get in the later stages. The author takes the reader through some basic algorithms for increasing the complexity as the player progresses. Like Wormy in the previous chapter, on-screen elements are kept track of by using an array to store an object's boundaries, but it works and it works very well. Using the concepts learned here, you can track a complex object in space and move it around with some interaction with the environment (e.g. walls and other pieces). This is revisited again in Chapter 9. A strong emphasis on game logic is the underlying theme of this section and it helps prepare the reader to create more complex games.

Chapter 8 brings autonomous characters into the mix as you create a simple variation of Katamari Damacy. You basically take control of a squirrel that runs around eating other smaller squirrels while avoiding being eaten by larger ones. As you consume the other objects, you increase in size. There are some huge concepts in this chapter such as sprite manipulation, camera manipulation and viewports (essential for side-scrollers, which is alluded to with a reference to Super Mario World). This basically allows you to create games that have very large playing areas while only showing a small section at a time. You also learn how to do some basic sprite movement to make it appear as if your character is jumping/bouncing with the introduction of the Sine mathematical function. Also nice to have if you want to throw a ball up in the air and have it come back down realistically. Not content to show you how to merely move the screen's camera around, a little bit of flair is introduced that gives the player's character some "slack" where he can move on the screen before the camera moves, as well as brief invulnerability when the player first spawns.. Again, just a nice thing to see in a book directed towards beginners.

Chapter 9 is not the last chapter but it is the one that ties everything together in one really nice setup. Here the game is Star Pusher, a clone of Sokoban. This is an isometric game using a tile-set and externally stored maps, actual sprites, collision detection, and more graphic techniques. Upon completion of this chapter, you will have just about everything you could need to build a 2D game.

Chapter 10 finishes things up with four additional games that you can use to reinforce what you have learned and discover new techniques. The games included are variants of Othello, Flood It, Connect Four, and Bejeweled. Of special importance here is the introduction of basic A.I. concepts in Othello and Connect Four.

There are a few things that I would have liked to have seen included. It would have been great to have an actual side-scroller game, since I know that a lot of people are interested in that. Manipulation of background images with basic parallaxing would have been useful in that context, too. Greater use of canvases for more complex UIs would be helpful for people interested in creating RPGs or RTSs. Seeing a little more done with sounds and sound caching (similar to Chapter 9's caching of sprites) would also have been welcome. Speaking of sprites, sprite animation would also be nice. It's one thing to move a character around on the screen. It's a whole 'nother world to see him dance. A demonstration of using multiple screens (beyond a game over one) is another thing that I would have liked to have seen. Lastly, I would have preferred if the concept of basic class objects was introduced as a data structure instead of a dictionary type, as used in Chapter 9. Maybe for the "Making Advanced Games..." book?

One other thing to keep in mind is that this is not a Python tutorial and you will need a reference on hand for both Python and the Pygame library. If you are new to Python, you will definitely want to start with his other book first. Also, much has been said about the fact that this book is available online for free. While that is true, there is a lot to be said for having the physical book in front of you. Al has done a great job with this book and should be rewarded. If you opt for the online version, please, at the very least, consider hitting the PayPal donation link on his site.

I've been a professional software developer and architect for almost 30 years and have used various methods to teach programming to colleagues, friends, and kids. I've found structuring the lessons around games to be a very effective approach. I found Al's first book, "Invent Your Own Computer Games with Python", to be a very useful starter in learning Python. My daughter (who was nine years old at the time) used the first book to learn Python with great success. From it, she came away with the ability to create a small-scale RPG involving a certain well-known teen wizard (yes, that one) that very quickly became an elaborate adventure game. "Making Games with Python and Pygame" has allowed her to more fully flesh out that first game and she is excitedly making plans for a slew of new games. It's great to see her enthusiastic about programming and even better that it didn't involve any coaxing from me. She basically did it all on her own.

If she can do it, so can you.

[Note: A friend of mine asked if I was a close personal friend of the author, based on my username. No, that's a reference to "Weird" Al Yankovic, whose fans are known as "A Warm, Close Personal Friend of Al"].
11 comment|31 people found this helpful. Was this review helpful to you?YesNoReport abuse
on March 19, 2012
Ever since I was around 7, I always wanted to create my own video games. Inspired by games like The Legend of Zelda: Ocarina of Time and Pikmin 2, I decided to finally learn how to make games. I found a pretty well-known program called Game Maker and began building my own games.

I continued using game maker for about 6 years, but by then I felt like I needed something more powerful. Game Maker was great, but it wasn't really what I wanted. After researching different languages to learn, I finally decided on Python, and to my luck, I was given a free review copy of "Making Games with Python and Pygame" from the author, Al Sweigart.

Before reading this book, one needs to know that this is not a book for complete beginners. Fortunately for me, Game Maker has taught me most of the concepts needed to fully understand the book, but someone brand-new to programming may have some trouble with it. Fortunately, Al has another book called "Invent your own computer games with Python" which is up for free download at [...]. This book doesn't touch on Pygame, but it shows you how to make basic games as well as teaching you the basics of Python.

The first thing that I've noticed when reading through the book is of how easy to read it is. I've worked through other textbooks trying to understand how everything works, but the explanations and definitions are too vague to make sense of what everything is. In this book, everything is much clearer. I can finally find out what a module and method is!

The book guides you through making simple games like clones of Tetris and Sokoban. After showing the source code for each of these games, Al breaks down the program and tells you what each line of code does and how it is significant. I found this to be a good way to understand how the code works, because you see it in action for yourself. There is even a glossary at the back if you need a quick explanation on a concept.

All in all, "Making Games with Python and Pygame" is a great book for anyone wanting to begin making their own games. Don't expect your own "Shadow of the Colossus" when you're done, but you will have the knowledge to put together very fun and cool indie games that could even be released online, if you wish. In short, "Making Games with Python and Pygame" is a great read, I recommend it.
0Comment|12 people found this helpful. Was this review helpful to you?YesNoReport abuse
on February 26, 2013
You know. I really enjoy this book. Al writes a great book; it is an enjoyable read. This prompted me to buy his other book - Invent your Own Computer Games with Python. Buy them both - you won't be disappointed. The quality of the book (Paper, cover, typeset) is very readable and high-quality for a computer book, which makes it a good library addition. Also, you can get the digital edition free, and lots of code/etc from website - so very good value.

Al presents python and pygame concepts in context of re-creating several typical games - like tetris, memory, othello, wormy, etc. Overall excellent pygame book. Pairs well with the rasperry pi computer... hint hint, nudge nudge. ( The games featured in this book are installed on raspberry pi stock image.. )

Honestly it's more fun than slogging through the pygame website, and example code. Pygame and this book allow you to quickly put together some pretty 'low tech' fun and easy games.

The book quickly introduces you to core display concepts like surfaces, drawing shapes, colors, blitting graphics, and playing sounds. Then it guides you through 'event handling' concepts over the course of several games. You will be up and running quickly making your own games with sound/graphics/event handling.

So, really a good intro / even intermediate intro / to pygame, which perhaps doesn't touch on pygame's more advanced topics very deeply. Focuses well on game design concepts, but doesn't get extremely deep into every bell and whistle of pygame, which to me was a good thing, and kept the book understandable and concise. It is not a 'reference' type book, and advanced pygame topics were not included.
0Comment|8 people found this helpful. Was this review helpful to you?YesNoReport abuse
on February 3, 2013
When I was a kid, I'd get these magazines every month full of code. You had to type it into your Apple or Commodore. It may or may not run. I looked forward every month to doing this. I have to say this is the first time in 30 years I had that same feeling.

I ignored PyGame for several years because the website has so poorly laid out. I got bored one weekend and decided to give it a whirl recently. I bought this book to give back to the project and I'm glad I did.

While this book won't make you a superstar video game programmer, it may help you build a solid foundation of the underlying code structure required. I had several eureka moments while typing in the examples. I'm a better programmer since reading this book. I wish I would have given PyGame a shot a few years ago.
0Comment|4 people found this helpful. Was this review helpful to you?YesNoReport abuse
on March 19, 2012
I read through Al's first book, Invent Your Own Computer Games with Python, 2nd Edition, which is a great introduction to programming using text-based games as a medium, however it left me wanting more complex, interesting games. This is where Making Games comes in, allowing one to take the next step towards making your own games.

Like the previous book, this includes all of the source code, allowing one to actually type and run the programs, something more theoretical books often lack. As a result, it's a very easy book to work your way through after work or on weekends. In addition, much of the code is able to be reused. For example, there is an implementation of the classic game Snake, which can be reworked into the classic Tron game. I would strongly recommend this book to someone who has always had an interest in making games, but hasn't had the time in the past.
0Comment|5 people found this helpful. Was this review helpful to you?YesNoReport abuse
on February 25, 2012
The book says that it is primarily intended for people with 'intermediate' programming skills, which describes me pretty well - I grok OOP, put loops in my loops so they can loop while they loop (while intentional) etc etc.

Everything is pretty easy to pick up, and presented in a way that it is easy to be reminded of whatever analogues you might have had in languages you're familiar with. For me, I kept comparing what I was reading and learning to how I would do it in AS3, and another piece would fall into place.

This book, some coffee, and a little initiative is your first tank of gas on the road to creating Python games.
0Comment|4 people found this helpful. Was this review helpful to you?YesNoReport abuse
on July 16, 2013
This series is a bunch of programs that the kids type in and explanations of how the programs work. It's a great jumping off point to messing around -- you start with something that works and change it up to do other things that are more interesting to you. It really doesn't teach computer science at all, the way we grown-ups understand it, but my daughter loves this approach and she's got time to learn the other stuff later. There's a lot to be learned just by the messing around that this book encourages.
0Comment|One person found this helpful. Was this review helpful to you?YesNoReport abuse
on April 1, 2014
Have you ever considered 2D game development? If so, this is a book for you! However, this book goes beyond just game development (although that is of course the main focus). For python you will be hard pressed to find a better guide to designing 2D apps in python, including GUI. Several of my coworkers have used this book as a foundation for building intermediate Python skills. Each chapter builds increasingly complex games while developing your CS skills. And as many people know, Python is one of the most readily accessible and useful programming languages available now. Building on the foundation set by Invent With Python, this book continues building your python skills to an intermediate level. Each chapter contains source code and a programming project. As the concepts are more complicated, each section is a bit meatier than the previous book, with a few less sections. And as with the previous book, this book is written to be understandable, so a child as young as 10 or 12 should be able to dig in and enjoy it. If you are an experienced developer however, never fear! You won't be bored as the projects are quite fun (especially Star Pusher!). The two books together should get you to a point where you can start inventing your own projects in Python!
0Comment|2 people found this helpful. Was this review helpful to you?YesNoReport abuse
on June 18, 2013
I am a student in software development, and programming games is all I've wanted to do since the moment I choose this career path. This book helped me get a feel for pygame(the python game library) and was very helpful. I don't suggest buying this book however, because it's completely free at his website. I wish I would have known that, but having the book made it easier to study when I wasn't around my laptop. Awesome book though!
0Comment|One person found this helpful. Was this review helpful to you?YesNoReport abuse
on March 16, 2016
Al Sweigart is one of the best guys out there and anything that he touches is gold. Check out his YouTube presentations and follow the links to his other stuff. If anyone wishes to learn Python and programming, this is the guy to follow. All stuff and no fluff!
0Comment|Was this review helpful to you?YesNoReport abuse