Commit a030b308 by BellCodeEditor

save project

parent 1a72fd95
Showing with 11 additions and 4 deletions
...@@ -3,6 +3,13 @@ from pygame import locals ...@@ -3,6 +3,13 @@ from pygame import locals
# 初始化pygame,为使用硬件做准备 # 初始化pygame,为使用硬件做准备
pygame.init() pygame.init()
position.append()
position.pop(0)
position=[(210, 120),(180, 120),(180, 90),(x,y)]
for i in len (position)-1:
screen.blit(right,position[i])
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660, 480)) screen = pygame.display.set_mode((660, 480))
...@@ -22,11 +29,11 @@ while True: ...@@ -22,11 +29,11 @@ while True:
x+=30 x+=30
screen.blit(background, (0,0)) screen.blit(background, (0,0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
screen.blit(right, (x, y)) screen.blit(right,position[-1] )
# 将贪吃蛇的身体画上去 # 将贪吃蛇的身体画上去
screen.blit(body, (210, 120)) #screen.blit(body, (210, 120))
screen.blit(body, (180, 120)) #screen.blit(body, (180, 120))
screen.blit(body, (180, 90)) #screen.blit(body, (180, 90))
# 将果实画上去 # 将果实画上去
screen.blit(food, (360, 300)) screen.blit(food, (360, 300))
# 刷新画面 # 刷新画面
......
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