Creating an overhead scrolling game

By using objects and images in our programs, we can create many types of 2D graphical games.

In this recipe, we will create a treasure hunt game where the player is trying to find buried treasure (by pressing Enter to dig for it). Each time the treasure has not been found, the player is given a clue to how far away the treasure is; the player can then use the cursor keys to move around and search until they find it:

Dig for treasure in your own overhead scrolling game

Although this is a basic concept for a game, it could easily be extended to include multiple layouts, traps, and enemies to avoid, and perhaps ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.