Caterpillar is a game written in C++ to test the SFML library. All resources has been drawn by myself in pixel Art. The Caterpillar asset is the smallest possible. Every rotation of asset is calculated in a single access to a matrix in which are stored the n times of 90 degrees rotation: the magic Matrix has on i index the direction of previous snakeBlock and on j index the direction of nest snakeBlock
{
{1,1,0,2},
{3,2,2,0},
{0,0,3,3},
{0,0,1,0}
};
Follow a simple screen with the final Result:
SFML LIBRARIES: https://www.sfml-dev.org/