Monday April 21st we are closed due to Easter Monday. Orders placed after Friday April 18th 16:00 will be shipped Tuesday April 22nd.
5137+ reviews
Order by 16:00 for same day shipping
14 days return
EN
Individual
Business
In this simple project you will learn how to make the game Hungry Bat in Scratch.
In this game your character is a bat. You can control it with the arrow keys. The goal of the game is to guide the bat to the taco without touching the yellow walls.
Scratch is a programming program on your Raspberry Pi . In this program you work with function blocks. This means that you do not write the programming text yourself. The blocks with the functions have already been made for you. You put these blocks in a diagram yourself. If you have downloaded the Raspbian software on your Raspberry Pi Scratch should be automatically on your Pi. If not, you must download it.
I program in Scratch on the Raspberry Pi 4 with 4GB. You can also program on the Raspberry Pi 3B+. You can also use the 1 GB or 2 GB with the Pi 4.
Are you programming in Scratch 2.0? Then you can still follow this tutorial. Keep in mind that certain functions may be in a different place. The images may also look different than on your screen. You can follow this tutorial because the code is the same.
Your program is probably in English. To follow the steps properly, it is wise to change the language in your program. You can change the language by clicking on the “globe” at the top left of your screen. This icon can be found next to the Scratch logo. Select Dutch.
On the side of the Raspberry Pi 4B are two Micro HDMI ports. Insert the Micro HDMI cable into the left port, and the HDMI end into a monitor or display.
Connect a keyboard & mouse to the USB ports and finally insert the power cable into the USB-C port.
Your setup is now ready to be booted.
When the Raspberry Pi starts up now you will see a desktop on your monitor. When you first start it up you still have to set it up, but that is explained step by step.
First we are going to choose a character. Next to the text: New Sprite: if you see a head, click on it. Now you see all the standard Sprites (characters). For this example I choose Bat2 (Figure 1). But of course you can also choose another character. If you have chosen a nice character, press OK. You can delete the standard character. Click on the icon with your right mouse button. Then click on delete
Now we're going to write the code so that your character can be controlled.
Now we are going to make our maze. We do this in the background. Choosing a background is a bit the same as choosing your character. Because we are going to make our own background, we click on the brush. With the square you can draw walls around which you have to let the character move. Experiment a bit to see what you like. By drawing these walls you can make the game more difficult by placing them close together, or easier by making the distances greater (Figure 3).
Now we create the finish.
As you can see, my character is too big (Figure 5), it hits the yellow walls directly. We are going to adjust this.
The bat has an extra appearance created by default. To check if your character has this too, go to Appearances. There you should see 2 or more versions of your character. You can also create an appearance yourself.
Now we will create a loss function.
Now you are done with your hungry bat game! Did you enjoy making it? Experiment a bit with this program. You can try adding sound effects yourself. Or you can add other objects in the game that the character has to collect. Have fun!