Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
reverse every other line of the array
// calculate x and y positioning of the pixel selected
auto y = pixel / 16;
auto shouldSnake = y % 2 == 0;
auto prevPixels = y * 16;
auto regularX = (pixel % 16);
auto snakeX = (15 - regularX);
auto x = shouldSnake ? snakeX : regularX;
auto snakePixelId = x + (lineOffset);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment