파이썬으로 추억의 게임 만들기(snake) (pip install freegames로 라이브러리 먼저 설치해야 합니다.) from turtle import * from random import randrange from freegames import square, vector food = vector(0, 0) snake = [vector(10, 0)] aim = vector(0, -10) def change(x, y): aim.x = x aim.y = y def inside(head): return -200 < head.x < 190 and -200 < head.y < 190 def move(): head = snake[-1].copy() head.move(aim) if not inside(head) or head in sn.. 2021. 12. 14. 이전 1 다음