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

save project

parent 1925b8a7 c238715l1405p256a14327/cloud528063
Show whitespace changes
Inline Side-by-side
Showing with 11 additions and 3 deletions
  • my_game.py
my_game.py
View file @ 747c6868
......@@ -23,7 +23,7 @@ y = 400
jumpState = "runing"
t = 30
bg_x = 0
road—_x = 0
road_x = 0
obstacle = random.choice([bush, stone, cacti])
rect = obstacle.get_rect()
rect.x = 1000
......@@ -59,9 +59,17 @@ while True:
index += 1
if index >= 5:
index = 0
bg_x-=1
if bg_x <= -1000:
bg_x=0
screen.blit(background, (bg_x, 0))
road_x -= 8
if road_x<=-1000:
road_x = 0
screen.blit(road, (road_x, 500))
# 将背景图画上去
screen.blit(background, (0, 0)) # 远处背景
screen.blit(road, (0, 500)) # 路
"""screen.blit(background, (0, 0)) # 远处背景
screen.blit(road, (0, 500)) # 路"""
screen.blit(wukong, (150, y)) # 悟空
if rect.x <= 0-rect.width: # 障碍物消失
......
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