Skip to main content
  • Book
  • © 2019

Python, PyGame, and Raspberry Pi Game Development

Apress

Authors:

  • Introduction to the PyGame framework and its workings
  • Use Python to access the GPIOs
  • Design a game from a code perspective

Buy it now

Buying options

eBook USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (24 chapters)

  1. Front Matter

    Pages i-xxv
  2. What Is a Programming Language?

    • Sloan Kelly
    Pages 1-3
  3. What Is Python?

    • Sloan Kelly
    Pages 5-9
  4. Introducing Python

    • Sloan Kelly
    Pages 11-31
  5. Breaking Free from the Interpreter

    • Sloan Kelly
    Pages 33-39
  6. Making Decisions

    • Sloan Kelly
    Pages 41-54
  7. Making the Raspberry Pi Repeat Itself

    • Sloan Kelly
    Pages 55-62
  8. Containers

    • Sloan Kelly
    Pages 63-75
  9. Putting It Together: Tic-Tac-Toe

    • Sloan Kelly
    Pages 77-85
  10. Basic Introduction to PyGame

    • Sloan Kelly
    Pages 87-97
  11. Designing Your Game

    • Sloan Kelly
    Pages 99-105
  12. Game Project: Bricks

    • Sloan Kelly
    Pages 107-125
  13. User-Defined Functions

    • Sloan Kelly
    Pages 127-139
  14. File Input and Output

    • Sloan Kelly
    Pages 141-151
  15. Introducing Object-Oriented Programming

    • Sloan Kelly
    Pages 153-170
  16. Inheritance, Composition, and Aggregation

    • Sloan Kelly
    Pages 171-180
  17. Game Project: Snake

    • Sloan Kelly
    Pages 181-212
  18. Model View Controller

    • Sloan Kelly
    Pages 213-231
  19. Audio

    • Sloan Kelly
    Pages 233-240
  20. Finite State Machines

    • Sloan Kelly
    Pages 241-250

About this book

Expand your basic knowledge of Python and use PyGame to create fast-paced video games with great graphics and sounds. This second edition shows how you can integrate electronic components with your games using the build-in general purpose input/output (GPIO) pins and some Python code to create two new games. 

You'll learn about object-oriented programming (OOP) as well as design patterns, such as model-view-controller (MVC) and finite-state machines (FSMs). Whether using Windows, macOS, Linux, or a Raspberry Pi, you can unleash the power of Python and PyGame to create great looking games. 

The book also includes complete code listings and explanations for "Bricks," "Snake," and "Invaders"—three fully working games. These allow you to get started in making your own great games and then modify them or build your own exciting titles. The concepts are further explained using games such as “Copycat,” where the player must concentrate and repeat the sequence of lights and sounds, and “Couch Quiz,” in which PyGame and electronic components create a quiz game for 2–4 players.

What You’ll Learn

  • Gain basic knowledge of Python and employ it for game development
  • Study game projects you can use as templates, such as Bricks, Snake, and Invaders
  • Work with user-defined functions, inheritance, composition, and aggregation
  • Implement finite state machines
  • Integrate your game with electronics using the GPIO pins

Who This Book Is For

Experienced coders or game developers new to Python, PyGame and Raspberry Pi would find this book helpful. It is also for beginners interested in getting into game development.

Authors and Affiliations

  • Niagara Falls, Canada

    Sloan Kelly

About the author

Sloan Kelly has worked in the games industry for nearly 12 years. He has worked on a number of AAA and indie titles and currently works for an educational game company. He lives in Ontario, Canada with his wife and children. Sloan is on Twitter @codehoose and makes YouTube videos in his spare time.

Bibliographic Information

Buy it now

Buying options

eBook USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access