Commit 2eb1c3d5 by BellCodeEditor

save project

parent c6188a1e
Showing with 25 additions and 8 deletions
import pygame import pygame#导入
from pygame import locals#获取方法
# 初始化pygame,为使用pygame做准备 pygame.init()#
pygame.init() FPSCLOCK=pygame.time.Clock()
screen=pygame.display.set_mode((800,600))
# 创建一个窗口 bg=pygame.image.load('bg.png')
?? right=pygame.image.load('right.png')
\ No newline at end of file apple=pygame.image.load('apple.png')
body=pygame.image.load('body.png')
x=240
y=60
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
x=x+50
screen.blit(bg,(0,0))
screen.blit(right,(x,y))
screen.blit(apple,(90,60))
screen.blit(body,(240-30,60))
screen.blit(body,(210-30,60))
screen.blit(body,(180-30,60))
pygame.display.update()
FPSCLOCK.tick(20)
\ 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