|Game Development Using Python|
Author: James R. Parker
There are a few books that teach game programming via the Pygame library and this is another, but with an emphasis on the academic. It starts off with chapter 0 - yes it's that sort of book - which gives a seemingly exhaustive classification of the different types of game. It is the sort of categorization that is typical when an academic tries to impose order where none is needed. It would probably make good material for a simple exam question.
The next two chapters take you through the basic elements of 2D game construction using simple examples and explanations. In the main the explanations are once again overly academic for the subject matter - this is not a dummies' guide to games.
Chapter 3 includes a very extended discussion of randomness which leans towards the philosophical - again the ideas that are relevant to game construction could have been covered in a more concise way. There is also a very simple introduction to probablity theory. There is no attempt to introduce object-oriented ideas or approach. When the term "object" is used it means some entity that is drawn as part of the game. This is a shame because objects make your code more powerful. If you code a sprite as a class then you can have as many of them as you like simply by creating instances.
Chapter 4 is strange in that it is titled Game AI: Collisions. I can't say that I have ever thought of collisions as anything at all to do with AI and after reading the chapter I'm even more convinced it has nothing to do with AI - this shakes your confidence in the book somewhat. If you can ignore AI being dragged into it, the discussion of collision detection is quite good, if nothing to do with AI.
The AI nonsense continues into Chapter 5 which introduces control methods. The idea of a finite state machine is introduced - informally and confusingly - and this is used to define the behavior of a car. This is a standard technique in computer science and certainly not AI. The chapter ends with a look at the A* algorithm, which is usually considered to be an AI algorithm, but I'm not convinced its relevant at this point.
Chapter 6 is about sound and as you might guess we start off with the physics of sound. Eventually we get to programming and how to use pygame to create simple sounds and eventually positional sounds.
Chapter 7 introduces a large example - a jet boat race. It starts with an academic discussion of prototyping the game and then goes into a lot of detail. The project is "finished" in Chapter 9 with sounds and other embellishments. However as an interlude we have Chapter 8 on animation. This is something of a surprise as animation is key to game construction and it really should have been earlier. The idea of key frame animation is the main topic, but it seems to be based on manual cartoon creation. There is no mention of ideas such as easing functions or automatic tweening and no mention of vector graphics to make the job easier. The final chapter is about networking and it covers the basic ideas of using sockets. A networked Pong game is developed, which exposes the reader to some of the problems of latency without really providing solutions.
Parts of this book are good and, as long as you don't mind the intrusion of academic considerations, you might find it a good way to learn about game implementation. For me the book didn't really concentrate sufficiently on software principles - for example the word "sprite" doesn't appear in the index. Although Pygame is object-oriented, the book doesn't emphasize an object-oriented approach to game construction. When a ball is needed we don't construct a ball class but simply keep track of position and draw a circle as part of the game loop. You could argue that using classes and objects isn't efficient, but if efficiency is your major concern you wouldn't be using Python anyway. There are books on Pygame that are more fun and better structured.
|Last Updated ( Wednesday, 05 February 2020 )|