Tag Archives: Raspberry Pi Geek

Articles and Scratch projects that appeared in Raspberry Pi Geek Magazine.

How to Create a Scrolling Sprite Project

Scrolling-sprite-script
sample scrolling sprites script.

Scrolling sprites is a sought-after skill for a Scratch programmer, and it sounds like a big challenge. Creating the effect is not as complicated as it may seem, however. In this article, I will introduce two methods to make sprites scroll – this is sometimes called a “scroller” project in Scratch. Scrolling is also a fundamental concept in creating a platform game, which is one reason Scratchers want to learn how to do it.

For this project, I won’t go through the entire process of drawing multiple frames with platforms in the Paint Editor. Instead, I’m going to remix the FishChomp game that comes bundled with the example projects in your Raspberry Pi version of Scratch.

Exploring the PicoBoard Sensors

One of the great all-around add-ons for Scratch is the PicoBoard, which plugs in very easily to the Raspberry Pi. In a previous issue of Raspberry Pi Geek, I introduced the resistance sensors on the PicoBoard by attaching them to a thermistor and measuring the resistance values of melting or warming water [1]. This time around, I’ll show you two animations you can do with the PicoBoard as educational projects or part of a larger project.

The first example uses musical fruits and veggies to explore the sound sensor and create some music scripts using the sound blocks in Scratch. If you don’t have a PicoBoard [2], the scripts shown here will still give you ideas and actual snippets of code that you can use to add music to other projects.

The second example creates a joystick to control the speed and direction of a sprite by using the slider and light sensor. The second half of the script demonstrates a universal way to move sprites to the opposite side of the stage after it passes the boundary.

Build a secret message encoder with Morse code.

In this issue, I’ll show you how to use the Scratch list feature to build a message encoder (or translator) that can be played back using a simple circuit on the GPIO. From a programming skills perspective, it will demonstrate how to manipulate the individual characters of much larger strings and transform them into something new.

I remember creating codes with my friends so that we could write “secret” notes to each other in school. Sometimes, the code used simple substitution (e.g., Z for A, Y for B, etc.), and other times the code was gibberish. In this project, I’m going to show you how to build your own message encoder using Scratch to substitute letters and numbers for Morse code.