Commit c4cab620 by BellCodeEditor

auto save

parent ef7dc539
apple.png

2.05 KB

bg.png

22.5 KB

body.png

1.4 KB

down.png

2.01 KB

left.png

2.07 KB

File added
right.png

2.05 KB

import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
screen=pygame.display.set_mode(size=(800,600))
bg=pygame.image.load('bg.png')
c=pygame.image.load('apple.png')
ui=pygame.image.load('right.png')
bb=pygame.image.load('body.png')
shi = pygame.time.Clock()
nn=[(0,0),(150,150),(150,180),(180,180)]
x,y=180,180
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
x+=30
screen.blit(bg,(0,0))
screen.blit(c,(210,300))
nn.append((x,y))
nn.pop(0)
screen.blit(ui,(x,y))
for i in range(len(nn)-1):
screen.blit(bb,nn[i])
# screen.blit(bb,(180,180))
pygame.display.update()
shi.tick(3)
\ No newline at end of file
up.png

2.05 KB

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