Commit 5fa67449 by BellCodeEditor

save project

parent 264dc7a2
Showing with 5 additions and 2 deletions
import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
...@@ -8,7 +8,8 @@ pygame.init() ...@@ -8,7 +8,8 @@ pygame.init()
screen = pygame.display.set_mode((660,480)) screen = pygame.display.set_mode((660,480))
background = pygame.image.load("bg.png") background = pygame.image.load("bg.png")
head = pygame.image.load("right.png") head = pygame.image.load("right.png")
body = pygame.image.load("apple.png") body = pygame.image.load("body.png")
apple = pygame.image.load("apple.png")
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -20,3 +21,4 @@ while True: ...@@ -20,3 +21,4 @@ while True:
screen.blit(body,(180,90)) screen.blit(body,(180,90))
screen.blit(body,(210,120)) screen.blit(body,(210,120))
screen.blit(apple,(600,390)) screen.blit(apple,(600,390))
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