Posts: 362
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Wormy Snake for Astro Pi / Sense HAT on Raspberry Pi 2-3

Wed Aug 30, 2017 1:34 pm


Notes and Credits
It was developed by me from scratch, but inspired by the behavior (not the code) of Snake or Wormy ("Masken" in Swedish).

Here is a YouTube video showing WormySnake running on Raspberry Pi 2 with SenseHAT:

It's originally made for AstroPi (Sense HAT by Raspberry Pi). SenseHAT is a hardware attached on top (HAT) for the Raspberry Pi $35 computer. The SenseHat related blocks turned into undefined blocks (red) when this project was uploaded to Scratch, but it still runs in standard Scratch 2. It can be fixed to run on Scratch 2 for Raspberry Pi 2 and 3, by replacing the procedure blocks with SenseHAT-blocks. You must first add the SenseHAT-extension in the More Blocks category. I have uploaded the original project here

It has dark colors in Scratch because the LEDs of the Sense HAT are very bright, and it uses the same colors.

About Astro Pi:

Click a green flag. Steer the snake using the arrow keys and eat the apples. Avoid colliding with the tail or the outside. The snake grows after each eaten apple. Eventually you will collide. The longer snake before game over, the better. Restart the game with Space or Enter.

On a real SenseHAT you can control the snake using the joystick, and press Enter by pressing the joystick. You can also use a SenseHAT emulator, that is included in Raspbian Stretch.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80…

Posts: 5
Joined: Mon Jan 02, 2017 11:00 pm

Re: Wormy Snake for Astro Pi / Sense HAT on Raspberry Pi 2-3

Tue Aug 21, 2018 4:02 am

I tried following your other related guide on setting up a mp3 player for the Pi 3 with Sensehat.
I tried to follow your steps, I managed to get Scratch 2 installed on my Pi 3 but when I go to More Blocks and Extensions it does not show the Sense HAT there.
Are you using something different to get the Sense HAT to show up in your Scratch 2?

Return to “Scratch”