Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 1.73 KB

README.md

File metadata and controls

56 lines (45 loc) · 1.73 KB

Snake app based on Tkinter

Hello, there! This is my first Snake app, which I built with python OOP conception. You will see all descriptions below. One of the futures of app that your snake speed growing after every 5 points.

How app looks like:

Requirements:

python pillow

1. First I installed virtual environment to my project

python -m venv env 

Before start working I activated working env

2. Installed pillow library for working with images

pip install pillow

3. Then I created class Snake, which I inherited from Canvas and made resizable main window

class Snake(tk.Canvas):
    pass
    ...

 #instance of Tk
 root = tk.Tk()
 #making resizable window
 root.resizable(False, False)

4. There are created 10 methods in the class include __init__ method:

Function name Description
load_assets Taking from assets img of food and snake 'png': food & snake
create_objects Creating food, snake objects and Score label
end_game Deleting all objects from window and showing Game over and Score
... ....

5. Added requirments.txt and to .gitignore added env folder.

6. Then project was pushed to Github

$ git init
$ git status
$ git add .
$ git commit -m 'My first app pushing to Github'
$ git remote add origin https://github.com/beckmiller/snake-game.git
$ git push -u origin master

That's all thank you for your attention!