Commit 26bfe0ad by BellCodeEditor

save project

parent 432afb25
Showing with 16 additions and 15 deletions
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
#初始化
pygame.init()
q = pygame.image.load('bg.png')
w = pygame.image.load('apple.png')
#e1 = pygame.image.load('boby.png')
r = pygame.image.load('down.png')
t = pygame.image.load('left.png')
y = pygame.image.load('right.png')
u = pygame.image.load('up.png')
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
# 创建一个窗口
screen = pygame.display.set_mode((600,480))
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
qwer = pygame.display.set_mode((660,480))
while True:
for qe in pygame.event.get():
if qe.type == locals.QUIT:
exit()
qwer.blit(q,(0,0))
qwer.blit(y,(240,120))
qwer.blit(w,(30,0))
pygame.display.update()
screen.blit(background,(0,0))
screen.blit(right,(2,120))
screen.blit(food,(360,300))
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