Commit 5b36098e by BellCodeEditor

save project

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