Skip to content

Commit 7db9419

Browse files
committed
Resolve merge conflict in Snake Game/main.py
1 parent abcdca2 commit 7db9419

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

Snake Game/main.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424

2525
food_score = Score()
2626

27-
# food_score.high_score()
2827
game_mode_on = True
2928
while game_mode_on:
3029
screen.update()
3130
time.sleep(0.2)
3231
for turtle in snake.all_snake:
3332
if turtle.xcor() > 290 or turtle.ycor() > 290 or turtle.xcor() < -290 or turtle.ycor() < -290:
3433
food_score.high_score1()
35-
# turtle.screen.textinput(title="Game Over", prompt="Name")
3634
snake.restart()
3735

3836
snake.move()
@@ -41,42 +39,11 @@
4139
hungry.generate_food()
4240
food_score.clear_score()
4341
snake.increase_size()
44-
# food_score.high_score1()
4542

4643
for snake_body in snake.all_snake:
47-
if snake_body==snake.head:
44+
if snake_body == snake.head:
4845
pass
4946
elif snake.head.distance(snake_body) < 10:
5047
food_score.high_score1()
51-
# turtle.screen.textinput(title="Game Over", prompt="Name")
52-
53-
screen.exitonclick()
54-
import turtle
55-
import time
56-
57-
screen = turtle.Screen()
58-
screen.bgcolor()
59-
screen.setup(600, 600)
60-
screen.tracer(0)
61-
all_snake = []
62-
positions = [(1, 0), (-20, 0), (-40, 0)]
63-
# y_position = [1, 2, 3]
64-
65-
for turtle_index in positions:
66-
its = turtle.Turtle(shape="square")
67-
its.penup()
68-
its.goto(turtle_index)
69-
all_snake.append(its)
70-
all_snake.append(its)
71-
72-
game_mode_on = True
73-
while game_mode_on:
74-
screen.update()
75-
time.sleep(0.1)
76-
for i in range(len(all_snake)-1, 0, -1):
77-
new_x = all_snake[i-1].xcor()
78-
new_y = all_snake[i-1].ycor()
79-
all_snake[i].goto(new_x, new_y)
80-
all_snake[0].forward(20)
8148

8249
screen.exitonclick()

0 commit comments

Comments
 (0)