Skip to content

OOP version Snake Game written in Python using the turtle library.

Notifications You must be signed in to change notification settings

resole79/snake_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

OOP version Snake Game written in Python using the turtle library.

Added High Score

Snake is a sub-genre of action video games where the player maneuvers the end of a growing line, often themed as a snake. The player must keep the snake from colliding with both wall and itself, which gets harder as the snake lengthens.

nokia snake game

Try to play Snake Game on google

It's a part of the #100DaysOfCode challenge by Angela Yu.

Prerequisites

You will need the following software to run the Snake Game:

Installation

To get started with the Snake Game, follow these steps:

  1. Clone the repository:
git clone https://github.com/resole79/snake_game.git
  1. Run the main.py file:
python main.py

File Structure

  • main.py: Main program.
  • snake.py: Snake class
    • Instance: list_of_piece, head
    • Method: create_snake, tail, add_tail, reset_snake, move_snake, snake_right, snake_left, snake_up, snake_down
  • food.py: Food class
    • Method: random_food
  • scoreboard.py: Scoreboard class
    • Instance: score, level, high_score, level_speed
    • Method: game_over, read_scoreboard_file, increase_score, increase_level, update_high_score, refresh_score
  • display.py: MyScreen class
    • Instance: list_of_window, this_window, x_coord, y_coord
    • Method: create_window, listen_snake
  • bord.py: BordGame class
    • Method: create_bord,

Usage

Press keys to move the snake:

  • "Right" to move right
  • "Left" to move left
  • "Up" to move up
  • "Down" to move up down

Snake Game

Snake Game

Snake Game

Credit

Author : Emilio Reforgiato (resole79)

About

OOP version Snake Game written in Python using the turtle library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages