Commit 377e0918 by BellCodeEditor

save project

parent 9e3de719
Showing with 16 additions and 11 deletions
......@@ -4,19 +4,24 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
background = pygame.image.load('bg.png')
apple = pygame.image.load('apple.png')
right = pygame.image.load('right.png')
left = pygame.image.load('left.png')
up = pygame.image.load('up.png')
down = pygame.image.load('down.png')
body = pygame.image.load('body.png')
x = 660
y = 480
# 创建一个窗口
screen = pygame.display.set_mode((x,y))
screen = pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
x -= 20
y -= 20
screen = pygame.display.set_mode((x,y))
screen = pygame.display.set_mode((x,y))
screen.blit(background,(10,10))
screen.display.update()
\ No newline at end of file
quit()
screen.blit(background,(0,0))
screen.blit(apple,(630,450))
screen.blit(right,(30,0))
screen.blit(body,(0,0))
screen.blit(body,(0,30))
screen.blit(body,(0,60))
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