Example #1
0
                direction = "UP"
            elif keys[pygame.K_DOWN]:
                direction = "DOWN"

            Win.fill((0, 200, 0))

            pygame.draw.rect(Win, (0, 0, 255), (a.x, a.y, a.apple_width, a.apple_height))
            running = s.DieSnake()
            Menu = s.DieSnake()

            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    running = False
                    Menu = False

            if a.ChekEat(s.SHead(), Win, s.body):
                point = point + 1

            s.SnakeGrowth(point)
            s.SnakeGo(direction, Win)

            pygame.display.update()
    elif ExitButton.Draw(200, 150, "Exit Game",):
        Menu = False

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            Menu = False
    pygame.display.update()

print("Your Score: " + str(point))