Python Games from Zero to Proficiency (Beginner): Python Games From Zero to Proficiency, #1
()
About this ebook
Get started with Python programming and Python games development fast without the headaches
Python is a great programming language; however, most people spend too long trying to learn how to code and create games with Python the hard way. This book is the only one that will get you to learn Python fast without wasting so much time. This book is the first book in the series "Python Games from Zero to Proficiency" where you will learn to code fast and be able to create your own video games with Python in no time.
What you will learn
After completing this book, you will be able to:
- Be comfortable with coding in Python.
- Use common structures to create programs in Python (e.g., loops, conditional statements, etc.).
- Know and master the features that you need to create 2D games (user interface, collision and keyboard detection).
- Read and extract data from files.
- Create popular 2D games such as hangman, tic-tac-toe or a coin collection game.
- Learn how to use the Pygame library.
Who this book is for
This book is for:
- Hobbyists who need a book that gets them started with Python and game development easily.
- Parents looking for a book that introduces their children to game programming painlessly.
- Teachers looking for a complete and clear resource on programming through the creation of games.
- Aspiring indie game developers.
How this book is different
This is the only book that you need to get started with Python and game programming fast and to enjoy the journey without frustration. This book includes seven chapters that painlessly guide you through the necessary skills to master Python and Python games development, use its core features, and create interesting 2D games. It assumes no prior knowledge on your part and ensures that you have all the information and explanations that you need every step of the way.
What this book offers
This book includes all the features that you need to get started with Python and game development:
- Learn without the headaches: This book assumes that you can't be expected to learn everything at once; this is why you will build all your skills incrementally.
- Make your dream of creating your own games come true: This book ensures that you stay motivated by giving you the right amount of information and challenge in each chapter; we all know that it's hard to keep motivated when learning a new skill, so this book always contextualizes the knowledge with an example (so that you feel it's relevant), and also makes sure that you get to challenge yourself, if you need to, with optional challenges present at the end of each chapter.
- Progress and feel confident in your skills: You will have the opportunity to learn and to use Python at your own pace and become comfortable with its core features. This is because every single new concept introduced will be explained in great detail so that you never feel lost. All the concepts are introduced progressively so that you don't feel overwhelmed.
- Create your own games and feel awesome: With this book, you will build your own 2D games and you will spend more time creating than reading, to ensure that you can apply the concepts covered in each section. All chapters include step-by-step instructions with examples that you can use straight away.
If you want to get started with Python games today, then buy this book now.
Patrick Felicia
Patrick Felicia is a lecturer and researcher at Waterford Institute of Technology, where he teaches and supervises undergraduate and postgraduate students. He obtained his MSc in Multimedia Technology in 2003 and PhD in Computer Science in 2009 from University College Cork, Ireland. He has published several books and articles on the use of video games for educational purposes, including the Handbook of Research on Improving Learning and Motivation through Educational Games: Multidisciplinary Approaches (published by IGI), and Digital Games in Schools: a Handbook for Teachers, published by European Schoolnet. Patrick is also the Editor-in-chief of the International Journal of Game-Based Learning (IJGBL), and the Conference Director of the Irish Symposium on Game-Based Learning, a popular conference on games and learning organized throughout Ireland.
Related to Python Games from Zero to Proficiency (Beginner)
Titles in the series (2)
Python Games from Zero to Proficiency (Beginner): Python Games From Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratingsPython Games from Zero to Proficiency (Intermediate): Python Games From Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratings
Related ebooks
Learn Python by Coding Video Games (Beginner): Learn Python by Coding Video Games Rating: 2 out of 5 stars2/5Python Games from Zero to Proficiency (Intermediate): Python Games From Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratingsLearn Python by Coding Video Games (Intermediate): Learn Python by Coding Video Games, #2 Rating: 0 out of 5 stars0 ratingsAdventures in Python Rating: 0 out of 5 stars0 ratingsPython Game Programming By Example Rating: 1 out of 5 stars1/5Python GUI Programming Cookbook - Second Edition Rating: 5 out of 5 stars5/5Python Projects for Kids Rating: 5 out of 5 stars5/5Python Tools for Visual Studio Rating: 0 out of 5 stars0 ratingsKivy – Interactive Applications and Games in Python - Second Edition Rating: 0 out of 5 stars0 ratingsTkinter GUI Application Development Blueprints Rating: 0 out of 5 stars0 ratingsGodot from Zero to Proficiency (Proficient): Godot from Zero to Proficiency, #5 Rating: 5 out of 5 stars5/5Godot from Zero to Proficiency (Beginner): Godot from Zero to Proficiency, #2 Rating: 5 out of 5 stars5/5The Ultimate Python Programming Guide For Beginner To Intermediate Rating: 5 out of 5 stars5/5Python for Beginners: Learn It as Easy as Pie Rating: 0 out of 5 stars0 ratingsUnity from Zero to Proficiency (Foundations) Fifth Edition: Unity from Zero to Proficiency, #1 Rating: 5 out of 5 stars5/5Code Gamers Development Essentials Rating: 0 out of 5 stars0 ratingsPython Interview Questions: Ultimate Guide to Success Rating: 0 out of 5 stars0 ratingsProcedural Content Generation for Unity Game Development Rating: 0 out of 5 stars0 ratingsConceptual Programming with Python Rating: 4 out of 5 stars4/5Python for Developers Rating: 0 out of 5 stars0 ratingsLearning Python Rating: 5 out of 5 stars5/5Godot from Zero to Proficiency (Advanced): Godot from Zero to Proficiency, #1 Rating: 5 out of 5 stars5/5Unreal Engine from Zero to Proficiency (Foundations): Unreal Engine from Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratingsGodot from Zero to Proficiency (Foundations): Godot from Zero to Proficiency, #1 Rating: 5 out of 5 stars5/5
Programming For You
Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsPython Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming Rating: 0 out of 5 stars0 ratingsThe Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsPokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Teach Yourself C++ Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5
Reviews for Python Games from Zero to Proficiency (Beginner)
0 ratings0 reviews
Book preview
Python Games from Zero to Proficiency (Beginner) - Patrick Felicia
Python Games From Zero to proficiency
(Beginner)
First Edition
––––––––
A step-by-step guide to coding your first game with Python and Pygame.
Patrick Felicia
Python Games From Zero to proficiency
(Beginner)
Copyright © 2022 Patrick Felicia
All rights reserved. No part of this book may be reproduced, stored in retrieval systems, or transmitted in any form or by any means, without the prior written permission of the publisher (Patrick Felicia), except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either expressed or implied. Neither the author and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
First published: August 2022
Published by Patrick Felicia
Credits
Author: Patrick Felicia
About the Author
Patrick Felicia is a lecturer and researcher at Waterford Institute of Technology, where he teaches and supervises undergraduate and postgraduate students. He obtained his MSc in Multimedia Technology in 2003 and PhD in Computer Science in 2009 from University College Cork, Ireland. He has published several books and articles on the use of video games for educational purposes, including the Handbook of Research on Improving Learning and Motivation through Educational Games: Multidisciplinary Approaches (published by IGI), and Digital Games in Schools: A Handbook for Teachers, published by European Schoolnet. Patrick is also the Editor-in-chief of the International Journal of Game-Based Learning (IJGBL), and the Conference Director of the Irish Symposium on Game-Based Learning, a popular conference on games and learning organized throughout Ireland.
Support and Resources for this Book
To complete the activities presented in this book you need to download the startup pack on the companion website; it consists of free resources that you will need to complete your projects. To download these resources, please do the following:
Open the page http://www.learntocreategames.com/books.
Click on your book (Python From Zero to Proficiency (Beginner))
On the new page, please click the link that says "Please Here Click to Download Your Resource Pack"
This book is dedicated to Mathis
[ ]
Table of Contents
Credits
About the Author
Support and Resources for this Book
Table of Contents
Preface
Content Covered by this Book
What you Need to Use this Book
Who this book is for
Who this book is not for
How you will learn from this book
Format of Each Chapter and Writing Conventions
Special Notes
How Can You Learn Best from this Book?
Feedback
Downloading the Solutions for the Book
Improving the Book
Supporting the Author
Chapter 1: Introduction to Programming in Python
Introduction
Statements
Comments
Variables
Arrays and lists
Dictionaries
Constants
Operators
Conditional statements
Match statements
Loops
Classes
Defining a class
Accessing class members and variables
Constructors
Inheritance
Functions and Methods
Default parameters and return types for functions
Scope of variables
Events or Signals
Workflow to create a script
Coding convention
A few things to remember when you create a script (checklist)
Common Errors
Level roundup
Summary
Quiz
Answers to the Quiz.
Checklist
Chapter 2: Creating your First Script
installing Python and an IDE
Your First Script
Creating your first function
Creating your own class
Using Modules
Best practices
Indentation
Maximum line length
Line breaks
Variable naming
Methods
Level roundup
Summary
Quiz
Answers to the Quiz
Checklist
Challenge 1
Chapter 3: Creating a Number Guessing Game
Resources necessary for this chapter
Creating a simple script to guess a number
Level roundup
Checklist
Quiz
Answers to the quiz
Challenge 1
Challenge 2
Chapter 4: Creating A word guessing game
Initializing the game
Displaying the word to guess and processing the users’ answer
gathering random words from a text file
Level roundup
Checklist
Quiz
Answers to the quiz
Challenge 1
Chapter 5: Using Graphics and the Pygame library
Installing Pygame
Drawing basic shapes onscreen
Creating a TicTacToe game
implementing Artificial intelligence
Level roundup
Checklist
Quiz
Solutions to the Quiz
Challenge 1
Challenge 2
Chapter 6: Creating a coin collection game
Introduction
Moving the player around
Collecting coins
Tracking and displaying the score
Creating the second level
Adding walls
Adding a timer
Adding a splash screen and end screen
Adding Animations
Adding a sound effect
Level roundup
Checklist
Quiz
Solutions to the Quiz
Challenge 1
Chapter 7: Frequently Asked Questions
Scripts
Interaction with assets
Using a graphical user interface
Audio
Detecting user inputs
Thank you
––––––––
Preface
This book will show you how you can very quickly code in Python and create games.
Python is a powerful programming language used in a wide range of industries and that you can use even if you have (or you are teaching with) computers with very low technical specifications.
This book series entitled Python Games From Zero to Proficiency allows you to play around with Python’s core features, and essentially those that will make it possible to create interesting 2D games rapidly. After reading this book series, you should find it easier to code in Python and to create simple yet entertaining video games.
This book series assumes no prior knowledge on the part of the reader, and it will get you started on Python so that you quickly master all the wonderful features that this programming language provides by going through an easy learning curve.
By completing each chapter, and by following step-by-step instructions, you will progressively improve your skills, become more proficient in Python, and create several games.
In addition to becoming proficient with Python, you will also create games that include many of the common techniques found in video games such as: level design, object creation, textures, collision detection, lights, weapon creation, character animations, particles, artificial intelligence, and menus.
You will learn how to create customized menus and simple user interfaces using both Python and Pygame, and animate and give artificial intelligence to Non-Player Characters (NPCs) that will be able to follow the player character using pathfinding.
Finally, you will also get to export your game at the different stages of the books, so that you can share it with friends and obtain some feedback as well.
[ ]
Content Covered by this Book
Chapter 1, Introduction to Programming in Python, provides an introduction to Python and to core principles that will help you to get started. It explains key programming concepts such as variables, variable types, or functions.
Chapter 2, Creating your First Script, helps you to code your first script. It explains common coding mistakes and errors in Python, and how to avoid them easily. It also goes through some common error messages for beginners, and explains what they mean and how they can be avoided easily.
Chapter 3, Creating a Number Guessing Game, gets you to add interaction to your games and to create a simple number guessing game. You will learn to create a scoring system, to use loops and conditional statements, and to detect and process the keys pressed by the user.
Chapter 4, Creating a Word Guessing Game, gets you to create a word guessing game where a random word from a large file will need to be guessed by the player. You will learn to use loops and global variables, to read data from a text file, and to display messages in the Command Prompt.
Chapter 5, Using Graphics and the Pygame Library, introduces the use of graphics with Python and Pygame so that you can draw objects onscreen, and detect mouse interaction from the user.
Chapter 6, Creating a Coin Collection Game, explains how you can create an adventure game where the player has to collect coins in order to move on to the next levels. Along the way, you also learn how to detect collisions, to move an animated character on screen, to create a splash screen as well as a timer.
Chapter 7 provides answers to Frequently Asked Questions (FAQs) related to the topics covered in this book (e.g., scripting, audio, interaction, AI, or user interface). It also provides links to additional exclusive video tutorials that can help you with some of your questions.
Chapter 8 summarizes the topics covered in the book and provides you with more information on the next steps.
What you Need to Use this Book
To complete the project presented in this book, you only need to install Python and Pygame (this will be explained in the next sections).
In terms of computer skills, all knowledge introduced in this book will assume no prior programming experience from the reader. So for now, you only need to be able to perform common computer tasks such as downloading files, opening and saving files, be comfortable with dragging and dropping items, and typing.
Who this book is for
If you can answer yes to all these questions, then this book is for you:
Are you a total beginner in Python?
Would you like to become proficient in the core functionalities offered by Python and Pygame?
Would you like to teach students or help your child to understand how to create games, using programming?
Would you like to start creating entertaining 2D games?
Although you may have had some prior exposure to Python or Pygame, would you like to delve more into these topics and understand the core functionalities in more detail?
Who this book is not for
If you can answer yes to all these questions, then this book is not for you:
Can you already code with Python to implement simple behaviors such as score, collision detection, or to update the user interface?
Can you already easily code a 2D game with Pygame and Python?
Are you looking for a reference book on Python?
Are you an experienced (or at least advanced) Python user?
If you can answer yes to all four