SnakeSpeed game.
(C) Nils Ulltveit-Moe 2010-2014
The game is licenced under a BSD licence. Please use it, modify it or share it if you find it useful.
This is a variant of the well known snake game. The snakes are competing about
eating the frog. The game was implemented as a report for a course in
Artificial Intelligence. My son helped me with the design using his toy snakes.
The game depends on PyGame and Rabbyt. On Ubuntu install with:
apt-get install python-pygame
apt-get install python-rabbyt
Different AI search methods can be used for different snakes:
-s human: Human controls the snake.
-s astarm: Snake with A* search with manhattan distance as heuristic (best).
-s astare: Snake with A* with Euclidian distance as heuristic.
-s astara: Snake with A* with the average of Euclidian and Manhattan distance.
-s dfs: Snake with depth-first search.
-s bfs: Snake with breadth-first search.
-l controls the length of the snake.
-i controls the percentage impassable blocks. A sensible value is -i 0.1, which
gives 10% impassable blocks.
-w width of playboard.
-h height of playboard.
The human controlled snake runs much faster than the AI snakes, to make the
game more playable.
This is a proof-of-concept game. It is playable, but lacks more advanced functionality like different levels, sometimes the snakes get stuck etc.
The game was written when my son was 4. He still gives it a thumbs up now
that he is 7.