Commit 0a7e7b6b by BellCodeEditor

save project

parent ac679386
Showing with 21 additions and 5 deletions
import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
bg = pygame.image.load("bg.png")
apple = pygame.image.load("apple.png")
right = pygame.image.load("right.png")
body = pygame.image.load("body.png")
up = pygame.image.load("up.png")
down = pygame.image.load("down.png")
left = pygame.image.load("left.png")
# 创建一个窗口 # 创建一个窗口
abc = pygame.display.set_mode((800,600)) abc = pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
abc.blit(bg,(0,0))
abc.blit(apple,(690,540))
abc.blit(right,(240,210))
abc.blit(body,(210,210))
abc.blit(body,(180,210))
abc.blit(body,(150,210))
abc.blit(body,(120,210))
pygame.display.update()
\ 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