You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if len(snake_list) >= snake_size:
temp_item = snake_list.pop(0)
#print(temp_item)
canvas.delete(temp_item[2])
canvas.delete(temp_item[3])
def check_if_we_found_present():
global snake_size
for i in range(len(presents_list)):
if presents_list[i][0] == snake_x and presents_list[i][1] == snake_y:
#print("found!!!")
snake_size = snake_size + 1
canvas.delete(presents_list[i][2])
canvas.delete(presents_list[i][3])
#print(snake_x, snake_y)
if snake_x>virtual_game_x or snake_x<0 or snake_y>virtual_game_y or snake_y<0:
game_over()
def check_we_touch_self(f_x, f_y):
global Game_Running
if not (snake_x_nav == 0 and snake_y_nav == 0):
for i in range(len(snake_list)):
if snake_list[i][0] == f_x and snake_list[i][1] == f_y:
print("found!!!")
Game_Running = False
from tkinter import *
import time
import random
Game_Running = True
game_width = 500
game_height = 500
snake_item = 20
snake_color1 = "red"
snake_color2 = "yellow"
virtual_game_x = game_width//snake_item
virtual_game_y = game_height//snake_item
snake_x=virtual_game_x//2
snake_y=virtual_game_y//2
snake_x_nav = 0
snake_y_nav = 0
snake_list = []
snake_size = 5
tk = Tk()
tk.title("Игра Змейка на Python")
tk.resizable(0,0)
tk.wm_attributes("-topmost",1)
canvas = Canvas(tk, width=game_width, height=game_height, bd=0, highlightthickness=0)
canvas.pack()
tk.update()
present_color1 = "blue"
present_color2 = "black"
presents_list = []
presents_size = 25
for i in range(presents_size):
print(presents_list)
def snake_paint_item(canvas, x, y):
snake_paint_item(canvas, snake_x, snake_y)
def check_can_we_delete_snake_item():
def check_if_we_found_present():
def snake_move(event):
canvas.bind_all("", snake_move)
canvas.bind_all("", snake_move)
canvas.bind_all("", snake_move)
canvas.bind_all("", snake_move)
def game_over():
def check_if_borders():
def check_we_touch_self(f_x, f_y):
while Game_Running:
def fun_nothing(event):
canvas.
The text was updated successfully, but these errors were encountered: