Commit 88094aeb by BellCodeEditor

save project

parent fdeac0e2
Showing with 24 additions and 3 deletions
import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
#加载图片
Load = [pygame.image.load('bg.png') ,pygame.image.load('apple.png') , pygame.image.load('right.png') , pygame.image.load('body.png')]
x = [0,240,330,300]
y = [0,120,210,210]
p_ng = 0
dx = 0
dy = 0
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((800,600),0,30) screen = pygame.display.set_mode((800,600))
\ No newline at end of file
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
dx = 0
dy = 0
for p_ng in Load:
screen.blit(p_ng,(x[dx],y[dy]))
dx += 1
dy += 1
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