Commit e5b7d4ca by BellCodeEditor

save project

parent 9af70ba2
Showing with 5 additions and 1 deletions
import pygame import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用硬件做准备 # 初始化pygame,为使用硬件做准备
...@@ -13,6 +14,8 @@ right = pygame.image.load('right.png') ...@@ -13,6 +14,8 @@ right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
pygame.time.Clock.tick(3) pygame.time.Clock.tick(3)
apple_x=360
apple_y=300
x,y=240,120 x,y=240,120
p=[(180,90),(180,120),(x,y)] p=[(180,90),(180,120),(x,y)]
while True: while True:
...@@ -41,6 +44,6 @@ while True: ...@@ -41,6 +44,6 @@ while True:
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, (apple_x,apple_y ))
# 刷新画面 # 刷新画面
pygame.display.update() 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