Commit 94803d25 by BellCodeEditor

save project

parent 259fba95
Showing with 14 additions and 5 deletions
...@@ -3,19 +3,28 @@ import pygame ...@@ -3,19 +3,28 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
FPSCLOCK=pygame.time.Clock()
x,y=90,0
# 创建一个窗口 # 创建一个窗口
a=pygame.display.set_mode((660,480)) a=pygame.display.set_mode((660,480))
e=pygame.image.load("body.png")
b=pygame.image.load("right.png") b=pygame.image.load("right.png")
c=pygame.image.load("bg.png") c=pygame.image.load("bg.png")
d=pygame.image.load("apple.png") d=pygame.image.load("apple.png")
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
x+=30
a.blit(c,(0,0)) a.blit(c,(0,0))
a.blit(b,(90,0)) a.blit(b,(x,y))
a.blit(e,(60,0))
a.blit(e,(30,0))
a.blit(e,(30,30))
a.blit(d,(90,60)) a.blit(d,(90,60))
pygame.display.update()
\ No newline at end of file pygame.display.update()
FPSCLOCK.tick(3)
\ 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