Commit 6ae2cea0 by BellCodeEditor

auto save

parent d06d6d1f
Showing with 18 additions and 1 deletions
import turtle
def nihao:
\ No newline at end of file
......@@ -3,11 +3,24 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
background=pygame.image.load('bg.png')#背景
right=pygame.image.load('right.png')#蛇头
body=pygame.image.load('body.png')#蛇身
apple=pygame.image.load('apple.png')#苹果
# 创建一个窗口
screen=pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
#接受到退出后结束程序
exit()
screen.blit(background,(0,0))#背景
screen.blit(right,(180,120))#蛇头
screen.blit(body,(150,120))#蛇身
screen.blit(body,(120,120))#蛇身
screen.blit(body,(120,90))#蛇身
screen.blit(apple,(360,300))#水果
pygame.display.update()#刷新画面
print("0")
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