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

Administrator / pygame_lesson7_diy4

  • 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 2089c6e1 authored a month ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 8b3c3110
Hide whitespace changes
Inline Side-by-side
Showing with 13 additions and 3 deletions
  • my_game.py
my_game.py
View file @ 2089c6e1
......@@ -17,7 +17,10 @@ index = 0
y=400
jumpstate = 'runing'
t=30
a = random
a = random.choice([stone,cacti,apple])
b = a.get_rect()
b.x = 1000
b.y = 500-b.height
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -49,6 +52,13 @@ while True:
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(wukong, (150, y))
if b.x<0-b.width:
a = random.choice([stone,cacti,apple])
b = a.get_rect()
b.x = 1000
b.y = 500-b.height
b.x-=8
screen.blit(a,(b.x,b.y))
# 刷新画面
pygame.display.update()
FPS.tick(20)
\ No newline at end of file
FPS.tick(100)
\ No newline at end of file
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