Commit 87fa590a by BellCodeEditor

save project

parent 36db3e4a
Showing with 26 additions and 2 deletions
#导入
import pygame
from pygame import locals
#初始化
pygame.init()
screen = pygame.display.set_mode((660,480))
\ No newline at end of file
#加载图片
bg = pygame.image.load("bg.png")
right = pygame.image.load("right.png")
body = pygame.image.load("body.png")
food = pygame.image.load("apple.png")
#创造窗口
screen = pygame.display.set_mode((660,480))
#无限循环
while True:
#事件监听
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
exit()
#渲染图片
screen.blit(bg,(0,0))
screen.blit(right,(240,210))
screen.blit(body,(210,210))
screen.blit(body,(180,210))
screen.blit(body,(180,180))
screen.blit(food,(300,300))
#刷新
pygame.display.update()
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