Commit 9c0644e6 by BellCodeEditor

auto save

parent 7f614f0d
Showing with 12 additions and 14 deletions
import pygame
from pygame import locals
from pygame import locals
#载入图片
background = pygame.image.load(bg.png)
right = pygame.image.load(right.png)
snake = pygame.image.load(snake.png)
food = pygame.image.load(apple.png )
#创建一个窗口
screen = pygame.display.set_mode((660,480))
#载入图片
background = pygame.image.load("bg.png")
right = pygame.image.load("right.png")
food = pygame.image.load("apple.png")
pygame.init()
while True:
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
#接收到数据后退出程序
exit()
#将背景画上去
screen.blit(background,(0,0))
#将贪吃蛇的头画上去
screen.blit(right,(290,120))
#将苹果
\ No newline at end of file
#将背景画上去
screen.blit(background,(0,0))
#将贪吃蛇的头画上去
screen.blit(right,(290,120))
#将苹果
\ 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