Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson3_diy3

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 6e0ecd22 authored a year ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 444a6180
Show whitespace changes
Inline Side-by-side
Showing with 3 additions and 2 deletions
  • snake.py
snake.py
View file @ 6e0ecd22
......@@ -23,7 +23,7 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right"
snake_head = right
score=0
apple_x=360
apple_y=300
......@@ -58,6 +58,7 @@ while True:
if x==apple_x and y==apple_y:
apple_x=random.randint(0,630)//30*30
apple_y=random.randint(0,450)//30*30
score+=10
else:
position.pop(0)
position.append((x, y))
......@@ -69,7 +70,7 @@ while True:
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
info="Score:"
info="Score:"+str(score)
text=my_font.render(info,True,(0,0,0))
screen.blit(text,(500,10))
# 将果实画上去
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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