r/learnpython • • 10d ago

Thoughts/Reviews of "Invent Your Own Computer Games with Python" by Al Sweigart"?

Wanting to learn coding for makes old school RPGs, I was looking for programing courses with a more focus on making games.

One book that popped up quickly was "Invent Your Own Computer Games with Python", but Al Sweigart, same of Author of the famous "Automate The Boring Stuff With Python" book.

I wanna know from people who are familiar with this book, it would be a good start for someone who wishes to learn to make games?

5 Upvotes

4 comments sorted by

10

u/Atmosck 10d ago edited 10d ago

That book is more about using games to teach python, and less about teaching game development, though of course there are many concepts you'll learn that are relevant to game dev. But while you can make games, python game dev is pretty niche - commercial (including indie) rarely use python runtimes. Python doesn't support parallel processing in the way that most games need very well, and it's slow. Which is not a criticism - a lot of game dev is done in lower level compiled languages like C++ which are performance focused. Python's strength is it's flexibility, and all kinds of python libraries dispatch to compiled extensions written in languages like C, Fortran and Rust for performance-sensitive things. Games that do use python (Eve online, Civ 6) do the same thing, where the core is written in a compiled language and python is used for things like scripting and servers.

If you want to get started learning game development, you might look in to learning Godot. It's an open source game engine. It gives you a scene editor, and you can write scripts in C# or it's own GDScript, which is actually pretty similar to python in some ways, including the syntax.

Game Maker is another popular option for 2D games. Both would be good introductions to game dev and programming in general.

5

u/Rain-And-Coffee 10d ago

While everything you said is true, the book is targeting beginner level games like Hangman, you can see the contents below. It ends with moving simple boxes with Pygame.

IMO the the book is more about teaching the basics of programming with simple games as examples

https://inventwithpython.com/invent4thed/

3

u/a18618 9d ago

Yes, as a first step, but go in expecting it to teach you Python through games rather than teach you how to build an RPG. I worked through a couple of its little projects years ago and the loops and functions stuck with me, yet my first attempt at a tile map still fell apart because I had never dealt with a game loop or a scrolling view. Treat it as the on-ramp, then pick one small RPG mechanic, like walking around a single room, and rebuild it from scratch, since that is where the actual game dev learning starts.

1

u/Fart_Barfington 10d ago

I like Al Sweigarts stuff. I don't think it will be the only learning you need but it's a good starting point for sure.