Invent Your Own Computer Games with Python teaches you how to program in the Python. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the example. The programs covered include Hangman, Tic Tac Toe, Reversi, Caesar Cipher, Guess the Number, and Dragon Realm. Later chapters cover how to make 2D graphical games using the popular Pygame library. You'll learn how to: * Put together loops, variables, input/output, and flow control statements into working programs * Use data structures such as lists, dictionaries, and tuples * Debug programs and find errors * Program simple game-playing AI opponents * Draw graphics and animation into your games The book is available under a Creative Commons license and can be downloaded in full for free from http: //inventwithpython.com "Invent with Python" was written to be understandable by kids as young as 10 to 12 years old, although it is great for anyone of any age who has never programmed before.
This book is brilliant. I can't gush enough about what a fabulous book this is to teach beginning programming to children. Each chapter introduces a few programming concepts through a simple game built on those concepts. The code for the game is then broken down step-by-step with very clear explanations. Plenty of "try this" and then "try that" hands-on experiments in each lesson to keep it real and keep kids engaged.
I especially like the reproduction of the relevant code for each step in a graphical box. No awkward flipping of pages back and forth, it's easy to keep track of exactly where you are, and you can quickly find certain points when you are flipping back to refer to them.
My son and I are working through this book during the summer. He has no programming experience, but was super excited at the concept of making games. He is thrilled with each new thing he learns and programs little variations on each chapter game as we go. Excited reader, demonstrating mastery of taught concepts, eager to learn more, and extrapolating what he's learned to build new things? Mark of a great teaching book.
Want to learn programming, but bored out of your mind with other programming books? Struggle with math? Can't figure out how to download even the most basic apps? Believe it or not, there is a book for people like you! (To be fair, my math skills are excellent and I don't struggle with any of these things, but I have friends and family who do.) This book was initially written with middle-school children in mind. It covers the basics of the Python programming language through the design of simple games, taking the reader from creating simple dialogues to finishing with a game of Battleship. Please note: this book is NOT intended for serious programmers who need to build a commercial Python app in the next few months. Try Lee's Python Programming Fundamentals, if you want that. This book is intended for the casual user, from child to pre-technology parents, and is best used as a fun, engaging hobby. ("What do you do for fun?" "I write games in Python.") Those who enjoy the book may find themselves wanting more, in which case other books are available. For those that say, "Programming is for geeks," please give this book a try. I found it as entertaining and enjoyable as my book on basic watercolor painting, and the implementation is much cheaper. Have fun!
A good book that taught me a few more really useful bits of Pygame I didn't know.
For instance, using a list of dictionaries to iterate over for collision detection with Rect objects stored under a 'rect' key... Kind of simple and yet inspired way to deal with large groups of similar objects whilst avoiding repetition and code bloat. This would be so useful for a bullet-hell style game.
Also, I somehow didn't know about the draw polygon tool or the full screen argument for pygame.display.set_mode().
Buying this book on an impulse to study and write games as a side project, I was disappointed in its content; it was more of a fun book to get started for a Python Programming 101 module. On the bright side, I'm excited to learn that game-making is an even better education approach than gamification. By setting up game rules and implementing them, programming provably becomes a versatile tool to assist you (as it rightfully is) in accomplishing the task and what's accompanied is the pure joy of creating your game.
I find there are two valuable takes from the book. Firstly, for seasoned developers, some games are good exercises to quickly familiarize with syntax and core programming components that are commonly shared among most programming languages. Secondly, I think it's a good book to teach newbies to think programmatically - the ability to break down any program to implementable atomic pieces of code, as well as the exploitation of computer strength in problem-solving, i.e. computer's speed and memory can arrive at a solution that is not humanly solvable in a reasonable time and outsmart our strategy in certain settings. To emphasize, this benefit is only fully realised if the reader spends time working out the code logic and actually plays with it. One more thing, the author took the trouble to point out common errors encountered and wrote a debugger chapter, which was very handful to clear out some doubts for first-time learners.
Below is the game I think are note-worthy to reinforce the points made above: - Guess the number/Bagels Deduction game: package importation, stdin/stdout, using loop to repeat code and terminate with break, data type conversion, if statement, comparison operators. - Dragon Realm: sketch a flow chart, define and call a function. - Hangman: getting to work with longer and more complex code, list (data access and operation), dictionary. - Tic tac toe: heuristic winning-strategy algorithm, 1D array. - Sonar treasure hunt: 2D array. - Ceasar Cipher: brute force approach to decipher the message. - Reversegame/Othello: reward-based brute force and simulation. - Dodger game: GUI, sound and image play.
In short: I was enjoying writing code and playing my games, all the while I just happened to be learning a programming language.
I was interested in learning python, and I've always been interested in game development. This book combined two of my interests, and it gave me 21 chapters of good, solid instruction on programming in general, as well as programming with python, as well as how things like input validation and game loops work.
The book covers several ASCII Art style console games, as well as a few graphical games using the pygame library.
While the book covers the material with the use of a program called IDLE, I used VS Code with the python extension installed, and it was pretty straightforward. I even tracked my progress across multiple computers via github. Here's my repo: https://github.com/kgar/invent-your-o...
This book has enough code for you to really get the python style of coding into your fingers, which is really important. I highly recommend hand typing all of the code you see in the chapters and contemplating what the code means as you enter it. It really helped me understand. I also would lightly debug my code where I mistyped things before using VS Code's diff editor to view my mistakes in comparison to the source code.
In the last few chapters, you start learning to code game loops with the pygame library. You process user events, perform collision detection, load assets into the game, play music and sounds, track top scores, and then some.
I'm looking forward to going through another book like this one, if I can find it. I'd love to go through another round of games at the next level of difficulty, taking the lessons learned from the games in this book and building upon them.
I will also say this: I'm still not sure how I feel about python as a programming language, but this book goes a long way to make coding in python fun.
The author has a fairly idiosyncratic approach that worked very well for me.
Other python books/courses I've tried start with syntax and get boring, fast.
This book's philosophy: Type and run the code first, then try and learn from it via examples and a discussion in the rest of the chapter.
Typing the code made me feel like I was making progress and also built a fair amount of muscle memory for Python syntax. I already know a lot of languages and so the Python syntax with its overuse of colons, mandatory indentation, case-sensitivity, horrendously stupid 'elif' keyword was very annoying in my previous attempts at learning from youtube videos.
Just doing the typing exercise to start off the chapter helped build my 'feel' for the language. There is a code-compare tool and the option to download the original source, which were both helpful.
And most of all, the exercises felt fun, because they were games, with an easily understandable purpose. Personally I thought the sonar game was so stupid I didn't bother to code it, but I enjoyed Othello and Dodger, the final project.
Learning the pygame library (or whatever the fuck its called) in the final few chapters was really cool! I was able to do a lot with graphics, music, keyboard and mouse input that felt like any 'modern' game. After completing the book, I feel that maybe with another month's practice, I could code a Super Nintendo-esque game with sprite animation and basic sound.
This book is a wonderful dive into both Python and game development. It's written for the newcomer to programming and assumes you have no former programming experience.
This starts with teaching you the basics of programming using Python. The book uses IDLE for the environment but this would translate to any modern IDE. It slowly works through the basics having you build console applications (like Hangman, Tic-Tac-Toe, and a joke telling program) before finally moving on to using Pygame to create games with graphics, scoring and collision detection.
If you are new to programming or just want to dive into game development, this is a wonderful book to pick up. Perfect for students / children interested in programming! It gradually walks you through all the important concepts from the most simple (Hello World) up to a graphical game with sounds, fonts and the like. While this isn't necessarily for an expert programmer (many of the concepts here veteran programmers will already know), this is a wonderful way to get started on your programming journey. I'm very impressed and I highly recommend this one!
Really for the beginning Python programmer, this text is well-written and explains code modules clearly for these simple games, such as they are. Those who know Python can just scan the code, whereas beginners will benefit from the text. The most valuable chapters for those learning programming are 12 (review of the Cartesian coordinate system), and chapters 15 and 16 (explanation of the Reversegam game and the "AI" algorithm). The parallels to computer chess game-playing are evident, and a good demystifying introduction to "AI." It would have added value to include some exercises or just text examples to encourage such out-of-the-text analogies, however.
Back in College I hated the way, the Professor teached Programming. I never understood, what he whanted. Telling about allegories and stuff. At home I started to create a text adventure. Very minimal. But in like one week I understood the whole basics of programming.
My past me wishes a book like this!!! For my new job I have to learn Python and this book helps me a lot. Al starts with the complete basics and gets step by step in a more complex direction.
It is fun to read regardless of wether you are Pro or Noob.
A very digestible and fun introduction for learning Python, particularly through one of my favorite things... Video Games! The language is easy to follow and the information presented is very clear and the explanations for each section of code is simple and easy to understand.
Most chapters begin with a program which you would type up yourself. Then, the chapter breaks down that particularly program in detail.
Definitely recommend if you're looking to learn Python, with a taste of what it's like to develop simple games.
Fun read!! Now I have a ninja game where the ninja runs around and kills zombies so that's pretty fun. Very accessible, but you definitely need to do independent coding outside of the book in order to get good. Overall really enjoyed it!
My son asked me: "Mam, I want to create a computer game...." I was looking for the first book about programming for him (he is 10 years old) and my friend suggested me this book. This is very good book for kids who want to make the first steps in programming. Do you remember your first game, like "Guess the Number", with this book you will remember your first experience and it is written in the way that your kid will have full attention to the content. It is started directly with examples and via examples you will be able to explain more and more programming concepts and terms. It was not easy for my son to read it in English, however if you read it together, help to translate, it becomes useful for both of you (you try to explain things using the words that even 10 years old kid can understand - not easy task honestly:). During reading this book we spent really exciting time together, so I would recomment it for people who have curious kids to bring them to the amazing world of programming.
Really great intro to Python. I don't know that this is the ONLY book one will need to learn Python, but it's a pretty good intro to it if you have no experience with programming. It uses fun and simple examples, it does a pretty good job at explaining most of what it has you do, and all in all it's a really great programming book.
I feel that learning to programme through books involves reading more than one book on the subject; it's one of those things that you just have to really study and immerse yourself in. So add this book to your list, and go for it.
This is a good book for beginner programmers in general. The author does a really good job breaking everything down so that kids can understand. Each chapter is a new simple game and he goes over what each parts of the code does and what it means in programming.
He even goes as far as explaining conventions across programming languages like camel case variables. I've been looking for a book like this for a long time to help my kids learn programming and I finally found one.
it's a nice book, has tons of information, and it's fun to read , and the author is doing his best to make it easier to understand python concepts, and best of all it's FREE.I do recommend it for anyone who'd like to get his hands dirty in programming in general or python in particular.