Commit 2b93ad00 by BellCodeEditor

save project

parent 7043d7a2
Showing with 16 additions and 5 deletions
import pygame import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口 pygame.init()
screen=pygame.display.set_mode((600,400)) screen=pygame.display.set_mode((600,450))
bab=pygame.image.load('bg.png')
food=pygame.image.load('apple.png')
right=pygame.image.load('right.png')
body=pygame.image.load('body.png')
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
print(event)
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
screen.blit(bab,(0,0))
screen.blit(food,(150,180))
screen.blit(right,(120,180))
screen.blit(body,(90,180))
screen.blit(body,(60,180))
screen.blit(body,(60,150))
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