Commit 1f2e5667 by BellCodeEditor

save project

parent 48fe89e2
Showing with 30 additions and 2 deletions
......@@ -3,11 +3,38 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
background = pygame.image.load("bg.png")
right = pygame.image.load("right.png")
food = pygame.image.load("apple.png")
up=pygame.image.load("up.png")
down=pygame.image.load("down.png")
left=pygame.image.load("left.png")
body=pygame.image.load("body.png")
screen = pygame.display.set_mode((600,400))
while True:
for event in pygame.event.get():
print(event)
#print(event)
if event.type == locals.QUIT:
exit()
screen.blit(background,(0,0))
screen.blit(right,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(150,120))
screen.blit(body,(120,120))
screen.blit(food,(240,240))
screen.blit(left,(90,90))
screen.blit(body,(120,90))
screen.blit(body,(150,90))
screen.blit(body,(180,90))
screen.blit(down,(240,90))
screen.blit(body,(240,60))
screen.blit(body,(240,30))
screen.blit(body,(240,0))
screen.blit(up,(30,90))
screen.blit(body,(30,120))
screen.blit(body,(30,150))
screen.blit(body,(30,180))
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