![]() ![]() ![]() More people have to see this! In NOVA Consulting Group we had plans for having a stand/display on NDC. I was really excited after creating the first version of the cube. The source code for the cube can be found on GitHub! "Can you make it bigger?" Tomas demoing the first prototype of the cube The game is over if you hit the bottom edge or if the snake hits itself.For each apple you eat, you grow 10 pixels.You have a limited number of steps until the snake starves and you have to eat apples to gain more steps.Stores the head position for every tic and traverses through the snake's body to be able to find the tail.The game is made by a 2-dimensional array consisting of a snake body with a direction, an apple, and empty spaces.The snake game was initially a demo that I made in F#, but I ported it to C# for convenience's sake. The microcomputer inside the cube is a Raspberry Pi 3B+. First prototypes of the cube (with celebratory beer of course □) Also, there's a special handling for going around the end of the rectangle. There's special handling when going from the top matrix to one of the sides and vice versa. When folding this into a cube, we have to map out where the snake head continues on that rectangle. 5 matrices are connected in a chain and make up a rectangle of 320 x 64 pixels (or 160 x 32 pixels when the matrix is 32 x 32). A challenging part of making snake on a cube is handling when a snake goes over an edge. A snake game is something that I thought would work well in a cube format. I had many thoughts about what I wanted the cube to do, but I landed on making a snake game for it. This made the communication from code to matrix easy as there were many pre-made libraries available. There was not a lot of complicated hardware to learn as I decided to use an adafruit HAT to connect the LED matrix to the Raspberry Pi. After reading a few tutorials I ordered the parts and got to building a LED cube. ![]() It was really a cool idea and I wanted to attempt making one. It even got some reach on Reddit! The system was in use for about two months taking up precious space in our washroom, much to my fiances' frustration.Īfter the irrigation system project, I saw a video of a man creating a LED video cube. I got to blog about it and tried out some new tech. After coming back from parental leave in January, I got to work creating my indoor irrigation system. It's been quite a journey! The ideaĢ022 was going to be my IoT year. One of my favorite things is making the snake game on the Raspberry Pi. With a new year beginning, I can sit back and reflect on the amazing things that happened last year. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |