Commit 502b285a by BellCodeEditor

auto save

parent 5798dec2
Showing with 20 additions and 3 deletions

1.4 KB | W: | H:

2.52 KB | W: | H:

body.png
body.png
body.png
body.png
  • 2-up
  • Swipe
  • Onion skin
import pygame 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)) screen = pygame.display.set_mode((660,480))
pygame.init()
while True: while True:
for i for event in pygame.event.get():
\ No newline at end of file print(event)
if event.type == locals.QUIT:
#接收到数据后退出程序
exit()
#将背景画上去
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