Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Game Programming By Example
  • Table Of Contents Toc
  • Feedback & Rating feedback
Python Game Programming By Example

Python Game Programming By Example

By : Alejandro Rodas de Paz, Joseph Howse
4.4 (10)
close
close
Python Game Programming By Example

Python Game Programming By Example

4.4 (10)
By: Alejandro Rodas de Paz, Joseph Howse

Overview of this book

With a growing interest in learning to program, game development is an appealing topic for getting started with coding. From geometry to basic Artificial Intelligence algorithms, there are plenty of concepts that can be applied in almost every game. Python is a widely used general-purpose, high-level programming language. It provides constructs intended to enable clear programs on both a small and large scale. It is the third most popular language whose grammatical syntax is not predominantly based on C. Python is also very easy to code and is also highly flexible, which is exactly what is required for game development. The user-friendliness of this language allows beginners to code games without too much effort or training. Python also works with very little code and in most cases uses the “use cases” approach, reserving lengthy explicit coding for outliers and exceptions, making game development an achievable feat. Python Game Programming by Example enables readers to develop cool and popular games in Python without having in-depth programming knowledge of Python. The book includes seven hands-on projects developed with several well-known Python packages, as well as a comprehensive explanation about the theory and design of each game. It will teach readers about the techniques of game design and coding of some popular games like Pong and tower defense. Thereafter, it will allow readers to add levels of complexities to make the games more fun and realistic using 3D. At the end of the book, you will have added several GUI libraries like Chimpunk2D, cocos2d, and Tkinter in your tool belt, as well as a handful of recipes and algorithms for developing games with Python.
Table of Contents (9 chapters)
close
close
8
Index

Installing packages


PyOpenGL is a package that offers Python bindings to OpenGL and related APIs, such as GLU and GLUT. It is available on the Python package Index, so you can easily install it via pip:

$ pip install PyOpenGL

However, we will need freeglut for our first examples, before we integrate OpenGL with Pygame. Freeglut is a third-party library that is not included if you install the package from PyPI.

On Windows, an alternative is to download and install the compiled binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl. Remember to install the version for Python 3.4.

Pygame is the other package that we will need in this chapter. It can be downloaded from the official website at http://www.pygame.org/download.shtml. You can install it from source if you want to; the compilation page contains the steps for building Pygame on different platforms.

Windows users can directly use the MSI for Python 3.2 or download Unofficial Windows Binaries from the Christoph Gohlke's website...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Game Programming By Example
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon