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

Administrator / pygame_lesson7_diy1

  • 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 f5dfcb42 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent d492d59d
Hide whitespace changes
Inline Side-by-side
Showing with 6 additions and 2 deletions
  • my_game.py
my_game.py
View file @ f5dfcb42
...@@ -21,12 +21,12 @@ t=30 ...@@ -21,12 +21,12 @@ t=30
index = 0 index = 0
y=400 y=400
jumpState="running" jumpState="running"
stone_x=1000
obstacle=random.choice([apple,stone,cacti]) obstacle=random.choice([apple,stone,cacti])
rect=obstacle.get_rect() rect=obstacle.get_rect()
rect.x=1000 rect.x=1000
rect.y=500-rect.height rect.y=500-rect.height
road_x=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -63,7 +63,11 @@ while True: ...@@ -63,7 +63,11 @@ while True:
rect.y=500-rect.height rect.y=500-rect.height
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
road_x-=8
if road_x<=-1000:
road_x=0
screen.blit(road, (road_x, 500))
screen.blit(wukong, (150, y)) screen.blit(wukong, (150, y))
rect.x-=8 rect.x-=8
......
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