Simple implementation of the classic Snake Game in under 100 lines of code

Overview

Snake_Game

Simple python implementation of the classic Snake Game in under 100 lines of code.

Printscreen of the game:

snake gameplay print

Imported Libraries:

  • random;
  • pygame;

Main Goal:

Eat as much food as possible.

Dying Condition:

The head of the snake must touch any other part of the snake's body.

Score:

The score can be seen in the top left corner of the window, in red numbers. It represents the size of the snake (or how much food has been eaten).

Description:

  • The snake moves in the same direction until one of the arrows is pressed;
  • There is "food" in the game (yellow square) which the snake can eat;
  • Every time the food is eaten (head of the snake and food are in the same position) the snake grows;
  • The snake "dies" (Game Over) when it touches itself;
  • If the snake goes beyond the game's window it appears in the opposite side of the window;
You might also like...
Software Design | Spring 2020 | Classic Arcade Game
Software Design | Spring 2020 | Classic Arcade Game

Breakout Software Design Final Project, Spring 2020 Team members: Izumi, Lilo For our Interactive Visualization, we implemented the classic arcade gam

The Classic Fruit Collecting game made in python with pygame
The Classic Fruit Collecting game made in python with pygame

FruitCollect A classic fruit Collecting game made with pygame Install pygame before running: "pip install pygame" Rules: Random fruits will drop from

We tried to recreate this classic game using python physics libraries.

We tried to recreate this classic game using python physics libraries. The result is certainly hilarious but enjoyable. One of my very first physics application.

Inflitator is a classic doom and wolfenstein3D like game made in Python, using the famous PYGAME module.
Inflitator is a classic doom and wolfenstein3D like game made in Python, using the famous PYGAME module.

INFLITATOR Raycaster INFLITATOR is a raycaster made in Python3 with Pygame. It is a game built on top of a simple engine of the same name. An example

PyCheckers - A classic board game implemented in pygame
PyCheckers - A classic board game implemented in pygame

PyCheckers! A classic board game implemented in pygame! Complete with every feature you need to play checkers! (including handsome sprites drawn by a

Python codes for the classic Hang Man game

Python codes for the classic Hang Man game. The user will be assigned a random word to guess, one character at a time. If the user gets everything right, the program says Well Done!, but if the user can't get the word right in 6 tries, the program says Game Over!

Building a Mario-like, classic platformer game in Python using the PyGame Library

Building a Mario-like, classic platformer game in Python using the PyGame Library

A classic alien shooting game.

Space-Invaders A classic alien shooting game. Description An open source game created by me and friends. How to play Install the latest python version

Blender Game Engine Game Type Templates Logic Bricks (and Python script) based Game Templates for Blender

Blender-Game-Engine-Templates Blender Game Engine Game Type Templates Logic Bric

Owner
Raffaele Fiorillo
Let code be the tool to make your dreams become reality!
Raffaele Fiorillo
Snake game mixed with Conway's Game of Life

SnakeOfLife Snake game mixed with Conway's Game of Life The rules are the same than a normal snake game but you have to avoid cells created by Conway'

Aidan 5 May 26, 2022
A simple yet powerful Snake Game made with myPygameWorkflow

snakeGame A simple yet powerful Snake Game made with myPygameWorkflow. Requirments python3 Python.org myPygameWorkflow Github Ripo Usage $ cd main $ p

DuskyElf 1 Dec 26, 2021
An open source Python library for the Snake retro game.

An open source Python library for the Snake retro game.

null 3 Jul 13, 2021
Un semplice Snake game , come negli anni 90!

Project-SnakeGame Un semplice Snake game , come negli anni 90! ITA VI porto un semplice giochino per i nostalgini degli anni 90 , ispirato al vecchio

Matt K Lawrence 1 Oct 17, 2021
This is a two player snake game

Trake This is a two player snake game How to play the game There is food and two players. You try to eat food to become large and gain points. Player

Grrub 1 Dec 19, 2021
A Snake Game built by Python Turtle Module 🐍

Snake-Game A Snake Game built with Python Turtle Module ?? Icons made by Freepik from www.flaticon.com Intro Control the direction of snake by simply

Megan 1 Oct 24, 2021
This is a text-based snake and ladder game .

This is a text-based snake and ladder game .

AKSHAI KRISHNA A 1 Nov 1, 2021
Snake Game in Python

Snake game is one of the most popular arcade games of all time. In this game, the main objective of the player is to catch the maximum number of fruits without hitting the wall or itself.

Pavan Ananth Sharma 4 Jul 5, 2022
Snake game made in python with the pygame library.

Pygame snake Snake game made in python with the pygame library. Requirements pip pygame Pygame Installation On the command line, type: pip install pyg

Ayza 3 Oct 2, 2022
A python snake game based on pygame.

PySnake A python snake game based on pygame. Requirements Package version pygame >= 2.1.2 opencv-python >= 4.5.1.48 Run Windows python main.py Linux &

null 2 Jan 31, 2022