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 Raspberry Pi cookbook for Python programmers
  • Table Of Contents Toc
  • Feedback & Rating feedback
Raspberry Pi cookbook for Python programmers

Raspberry Pi cookbook for Python programmers

4.8 (13)
close
close
Raspberry Pi cookbook for Python programmers

Raspberry Pi cookbook for Python programmers

4.8 (13)

Overview of this book

Table of Contents (18 chapters)
close
close
Raspberry Pi Cookbook for Python Programmers
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Index

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; they 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, perhaps even additional tools or puzzles to solve. With a few adjustments to the graphics, the character could be exploring a dungeon or spaceship or hopping through the clouds collecting rainbows!

Getting ready

The following example uses a number of images; these are available as part of the book's resources. You will need to place the nine images in the same directory...

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.
Raspberry Pi cookbook for Python programmers
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