Commit 296b4a13 by BellCodeEditor

auto save

parent 57521a2a
Showing with 21 additions and 5 deletions
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
backgroud = pygame.image.load("bg.png")
apple = pygame.image.load("apple.png")
snake = pygame.image.load("right.png")
body = pygame.image.load("body.png")
# 创建一个窗口
screen = pygame.display.set_mode((660,480))
screen = pygame.display.set_mode((500,500))
print(locals.QUIT)
i = 0
while True:
for event in pygame.event.get():
if event.type == 12:
if event.type == locals.QUIT:
exit()
screen.blit(backgroud,(0,0))
screen.blit(apple,(360,300))
screen.blit(snake,(240,120))
#screen.blit(body,(240,90))
#screen.blit(body,(240,60))
#screen.blit(body,(240,30))
#screen.blit(body,(210,30))
i+=1
screen.blit(snake,(i,120))
screen.blit(body,(i,120))
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