Commit f8e8cce1 by BellCodeEditor

auto save

parent 5e4ce663
Showing with 0 additions and 107 deletions
#导入
import pygame
#导入
from pygame import locals
#初始化
pygame.init()
#载入图片
bg = pygame.image.load("bg.png")
right = pygame.image.load("right.png")
food = pygame.image.load("apple.png")
body = pygame.image.load("body.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,120))
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(180,90))
screen.blit(food,(100,120))
#刷新界面
pygame.display.update()
\ No newline at end of file
#导入
import pygame
from pygame import locals
#初始化
pygame.init()
#加载图片
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,120))
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(180,90))
screen.blit(food,(300,120))
#刷新界面
pygame.display.update()
#导入
import pygame
from pygame import locals
#初始化
pygame.init()
#加载图片
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,120))
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(180,90))
screen.blit(food,(300,120))
#刷新界面
pygame.display.update()
\ No newline at end of file
...@@ -10,7 +10,6 @@ right = pygame.image.load('right.png') ...@@ -10,7 +10,6 @@ right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
#print(event) #print(event)
......
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