Commit 4cea351a by BellCodeEditor

save project

parent c6188a1e
Showing with 28 additions and 6 deletions
import pygame
import pygame #导入
from pygame import locals #获取方法
pygame.init() #初始化 模块
s=pygame.time.Clock() #设置帧数
screen=pygame.display.set_mode((800,600))#设置窗口
#载入图片
bg=pygame.image.load("bg.png")
right=pygame.image.load("right.png")
food=pygame.image.load("apple.png")
body=pygame.image.load("body.png")
# 初始化pygame,为使用pygame做准备
pygame.init()
x=60
y=60
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
x=x+30
# 创建一个窗口
??
\ No newline at end of file
#渲染
screen.blit(bg,(0,0))
screen.blit(right,(x,y))
screen.blit(food,(300,240))
screen.blit(body,(210,210))
screen.blit(body,(180,210))
#刷新
pygame.display.update()
s.tick(10)#设置 帧数
\ 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