Commit 7b659d68 by BellCodeEditor

save project

parent 83c9fbe6
Showing with 16 additions and 4 deletions
import pygame import pygame
# 初始化pygame,为使用pygame做准备
from pygame import locals from pygame import locals
from random import randint
pygame.init() pygame.init()
# 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
bg=pygame.image.load('bg.png')
ap=pygame.image.load('apple.png')
bd=pygame.image.load('body.png')
left=pygame.image.load('left.png')
right=pygame.image.load('right.png')
up=pygame.image.load('up.png')
down=pygame.image.load('down.png')
while True: while True:
for a in pygame.event.get(): for a in pygame.event.get():
print(a) print(a)
if a.type==locals.QUIT: if a.type==locals.QUIT:
exit() exit()
screen.blit(background,(0,0)) screen.blit(bg,(0,0))
\ No newline at end of file screen.blit(ap,(30*21,15*30))
screen.blit(right,(90,90))
screen.blit(bd,(60,90))
screen.blit(bd,(30,90))
screen.blit(bd,(0,90))
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