NATHAN242's Projects

Projects

Tools

Libraries

Web Tools


SDL-Snake

Project repo: LINK

Compiled to WebAssembly: PLAY IN BROWSER (v1.0.1) PLAY IN BROWSER (v1.1.0)

Introduction

Snake game in C++ using SDL.

Version 1.0.1:

Version 1.1.0 with updated graphics:

Details

Use the arrow keys to move the snake. Collect the food (red) and the snake will grow. Crashing the snake into the edges of the screen or itself will cause a game over. Press Q to quit and your score will be printed to the console.

Launch the game with the -h parameter to show the command line options to configure the game:

SDL Snake v1.0.1
Usage: ./snake [-h] [-x X RESOLUTION] [-y Y RESOLUTION] [-s INITIAL SNAKE SIZE] [-d SNAKE DELAY]
 -h - Show this help
 -x X RESOLUTION - Set X resolution (default: 200)
 -y Y RESOLUTION - Set Y resolution (default: 200)
 -s INITIAL SNAKE SIZE - Set initial snake size (default: 3)
 -d SNAKE DELAY - Delay before snake moves (default: 80)