Commit 9ef0a761 by BellCodeEditor

save project

parent 77cc5fe3
Showing with 18 additions and 2 deletions
......@@ -2,11 +2,26 @@ import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
bg=pygame.image.load('bg.png')
right=pygame.image.load('right.png')
food=pygame.image.load('apple.png')
body1=pygame.image.load('body.png')
body2=pygame.image.load('body.png')
body3=pygame.image.load('body.png')
food2=pygame.image.load('apple.png')
food3=pygame.image.load('apple.png')
# 创建一个窗口
Screen=pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
exit()
Screen.blit(bg,(0,0))
Screen.blit(right,(240,90))
Screen.blit(food,(480,270))
Screen.blit(body1,(210,90))
Screen.blit(body2,(180,90))
Screen.blit(body3,(180,60))
Screen.blit(food2,(450,540))
Screen.blit(food3,(150,390))
pygame.display.update()
\ No newline at end of file
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