Mission Python

Author: Sean McManus
Publisher: No Starch Press
Pages: 280
ISBN: 978-1593278571
Print: 1593278578
Kindle:  B072STNXT8
Audience: Young, next generation Pythonistas
Rating: 4
Reviewer:Mike James
Code an adventure game in Python  - a good way to learn?

This book is aimed at complete beginners and it claims to be suitable for the age range 12 and up. It is most definitely aimed at young potential programmers. The idea is that you learn Python with the help of Pygame and an adventure game. It is clearly written and well presented and you couldn't wish for a better book of its type, but you have to be very clear what its "type" is. What it does is to attempt to motivate the reader by suggesting that everything is as exciting as say a space launch or a trip to mars or ....

For example the introduction starts:

"Air is running out. There's a leak in the space station, so you've got to act fast. Cam you find your way to safety? You will need to navigate your way around the space station, find access cards to unlock doors, and fix your damaged space suit. The adventure has begun!"

At this point the well known quote from Marvin, the Paranoid Android from HHGTTG came into my head: 

"I wish you'd just tell me rather trying to engage my enthusiasm because I haven't got one."

When computers were a new thing, new programmers often got started by writing games, but now you can buy games that will blow your neurons off and keep your heart racing. The times have changed so much that you cannot create games of your own that compete with the big bucks productions of the game studios - there is little motivation in this area. How to motivate children to get interested enough in programming is a big problem these days, especially when there is so much to learn and not a lot to impress another person.

Of course, it is usually the case that the challenge of programming is enough and suceeding is its own reward. It's a bit like taking a pottery class - the pot that you create might be terrible, but you made it starting from clay. Yes, there is satisfaction to be had but I'm not sure that it needs this sort of motivation. 

You might disagree and if so I can recommend this book.

Banner

The book deals with all the usual things in the introduction - getting Python, installing it on Windows and a Raspberry Pi, getting Pygame and downloading the prepared files of the game. All of the games assets, graphics, sounds and indeed the entire game is available in a zip file. If you are acting as a teacher you might want to keep this hidden from your victim as instant gratification might short circuit your efforts.

Chapter 1 have the title "Your First Spacewalk" and basically its about displaying text and some graphics. Towards the end of the chapter you get do move a graphic around with the arrow keys.

From here the level slowly but steadily ramps up. Chapter 2 introduces the basic Python data structure - the list. Chatper 3 deals with loops. Chapter 4 explains how to draw a game play area using a map and converting the map to the appropriate graphics. This is where the listings first get long and intimidating.

 


Chapter 5 introduces the dictionary object and the listing gets even longer.  Chapter 6 and 7 carry on in this way while you learn about animation with the help of a supplied graphic - which is also printed on the corner of each page so if you flip the pages you see the animation, a nice touch.

From around this point the book is increasingly driven by the needs of the game that is being created. There is no real attempt to teach Python as a logical subject and this is a conseqence of starting out with the idea that the aim of the book is to create a game and learn Python as a spinoff. If you adopt this approach there isn' t much that can be done differently.

The book closes with some appendices. Perhaps the first appendix gives another clue as to what you are taking on if you follow the book's progress. The full listing is about 26 pages long and this is what you are trying to recreate. Again there is nothing that can be done about this. Even a slighly realistic adventure game is going to take this sort of effort.

You might say that in the old days 26 pages of code was nothing - but it was. Most games were much simpler than this and four or five pages was enough. There is also the issue that being guided to write 26 pages of code isn't the same as spontaneously generating 26 pages of code because you know what you are doing. You start out understanding Python, knowing what you want to create and it sort of just grows and 26 pages is easy to exceed.

How much duller the book would be if it started out with the statement that "you are going to have to type in 26 pages of code". And I guess this is the whole crux of whether you regard this as a good book or a misguided book. If you think you can learn Python by being spoonfed chunks of code to build a game then this is one of the best books that take this approach.

  • Mike James is the author of Programmer's Python: Everything is an Object published by I/O Press as part of the  I Programmer Library. With the subtitle "Something Completely Different" this is for those who want to understand the deeper logic in the approach that Python 3 takes to classes and objects. 

 

Banner


Learn to Code by Solving Problems

Author: Dr. Daniel Zingaro
Publisher: No Starch Press
Date: June 2021
Pages: 335
ISBN: 978-1718501324
Print: 1718501323
Kindle: B08FH92YL8
Audience: People wanting to learn Python
Rating: 4
Reviewer: Mike James
Solving problems - sounds good?



Professional C++, 5th Ed (Wrox)

Author: Marc Gregoire
Publisher: Wrox
Date: February 2021
Pages: 1312
ISBN: 978-1119695400
Print: 1119695406
Audience: C++ developers
Rating: 4
Reviewer: Mike James


Professional C++? Who wants to be unprofessional?


More Reviews


<ASIN:1871962587>

Last Updated ( Saturday, 18 May 2019 )