Commit cad7cb1e by BellCodeEditor

save project

parent 57288a3c
import pygame import pygame
pygame.init()
from pygame import locals from pygame import locals
background = pygame.image.load("bg.png")
right = pygame.image.load('rigth.png')
body = pygame.image.load('body.png')
food = pygame.image.load('apple.png')
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660,480)) screen = pygame.display.set_mode((660,480))
...@@ -10,3 +16,8 @@ while True: ...@@ -10,3 +16,8 @@ while True:
print(event) print(event)
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
screen.blit(background,(0,0))
screen.blit(food,(30,30))
screen.blit(right,(90,90))
screen.blit(body,(60,60))
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