Commit 7e72af28 by BellCodeEditor

save project

parent 18b650e7
Showing with 17 additions and 1 deletions
...@@ -2,11 +2,27 @@ import pygame ...@@ -2,11 +2,27 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
x=240
y=120
Time=pygame.time.Clock()
pygame.init() pygame.init()
black=pygame.image.load("bg.png")
apple=pygame.image.load("apple.png")
right=pygame.image.load("right.png")
body=pygame.image.load("body.png")
# 创建一个窗口 # 创建一个窗口
win=pygame.display.set_mode((660,480)) win=pygame.display.set_mode((660,480))
while True: while True:
for e in pygame.event.get(): for e in pygame.event.get():
if e.type==locals.QUIT: if e.type==locals.QUIT:
exit() exit()
x+=30
win.blit(black,(0,0))
win.blit(apple,(360,300))
win.blit(right,(x,y))
win.blit(body,(210,120))
win.blit(body,(180,120))
win.blit(body,(180,90))
pygame.display.update()
Time.tick(3)
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