linglong97 / SnakeGame

Taking inspiration from the popular youtube series "Gaming Coding Challenges", I decided to start coding this summer by making a set of basic games. This one's the classic snake game, where you start out as a black, and get longer as your snake eats more blocks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SnakeGame

Taking inspiration from the popular youtube series "Gaming Coding Challenges", I decided to start coding this summer by making a set of basic games. This one's the classic snake game, where you start out as a black, and get longer as your snake eats more blocks.

The game was made in python 2.7, and requires the PyGame module.

Coding this Game

For this project, it was relatively straightforward to construct the game. The logic required involved looping through the game and checking if the keys were pressed to activate the motion of the snake. The snake itself was stored as an array, with each element in the array having a position. This array was then deep copied to be used to display the position of the snake after movement. When the snake picks up the Red block, we store the current position of the snake, and simply add another block to replace the head of the current snake.

About

Taking inspiration from the popular youtube series "Gaming Coding Challenges", I decided to start coding this summer by making a set of basic games. This one's the classic snake game, where you start out as a black, and get longer as your snake eats more blocks.


Languages

Language:Python 100.0%