Commit 8ec2c7e4 by BellCodeEditor

save project

parent d5739bd2
Showing with 4 additions and 0 deletions
import pygame
from pygame import locals
import random
# 初始化pygame,为使用硬件做准备
pygame.init()
......@@ -41,6 +42,9 @@ while True:
if event.key == locals.K_DOWN and setheading != "up":
setheading = 'down'
snake_head = down
if x == apple_x and y == apple_y:
apple_x = random.randint(0,660)
apple_y = random.randint(0,480)
# 设置贪吃蛇的头部坐标
if setheading == "right":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment