Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

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 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.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80…

Return to “Scratch”

Who is online

Users browsing this forum: No registered users and 3 guests