Commit 3bb8e313 by BellCodeEditor

save project

parent e9729155
Showing with 18 additions and 4 deletions
import pygame import pygame
from pygame import locals
background = pygame.image.load("bg.png")
apple = pygame.image.load("apple.png")
body = pygame.image.load("body.png")
snake1 = pygame.image.load("left.png")
snake2 = pygame.image.load("right.png")
snake3 = pygame.image.load("up.png")
snake4 = pygame.image.load("down.png")
# 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
screen = pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
screen.blit(background,(0,0))
screen.blit(apple,(0,0))
screen.blit(body,(0,0))
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