FREE Sample – Chapter 4 – Creating Games and Graphics
Packt Publishing have made available Chapter 4 of the book available FREE to download:
On the “Sample Chapters” tab, simply click on “download sample chapters in PDF format” link to download and view it.
This chapter explains how to create a drawing application and graphical games using the Tkinter Canvas.
Using IDLE3 to debug your programs
Drawing lines using a mouse on a Tkinter Canvas
Creating a bat and ball game
Creating an overhead scrolling game
The final example “Creating an overhead scrolling game” uses several images as sprites, which you will need in order to run the program.
To download the image files used in the sample chapter directly on your Raspberry Pi use the following command:
Alternatively, you can download the files directly here.
Just ensure that when you run your scroller.py script, the following files are in the same directory.
bg.gif, gold.gif, mark.gif, playerD.gif, playerL.gif, playerR.gif, playerU.gif, wallH.gif, wallV.gif
You can also download the full code files for the book by selecting the “Support” tab and selecting “Download Files“. You will need to register your email address and you should receive a direct link to the file.
Any questions or comments, then feel free to let me know.