Posts 3D snake game for the LEDcube

3D snake game for the LEDcube


I’ve just finished the next application for my FadeCube, a 3D snake game! It is a very small pure C application, developed under Linux with CodeBlocks IDE. It uses a multithreaded solution. Actually it is my first try to use POSIX threads.

The first thread is listening for the keyboard. Another one is computing the snake pieces and the food. Tthe third is responsible to render the cube data and sends it to the cube. It’s always blocked on a mutex, until the snake thread sends a signal.

The snake length is always incremented when it eats :-) . It is controlled by WASD and /’ buttons.

The result:

It seems much better in live.

The code:



This post is licensed under CC BY 4.0 by the author.