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

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

save project

parent c066a5a4
Hide whitespace changes
Inline Side-by-side
Showing with 7 additions and 4 deletions
  • my_game.py
  • record.txt
my_game.py
View file @ 37648294
...@@ -77,6 +77,9 @@ while True: ...@@ -77,6 +77,9 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
if event.type == locals.MOUSEBUTTONDOWN:
mouse_x,mouse_y=event.pos
speed = 8+score//3 speed = 8+score//3
...@@ -92,14 +95,14 @@ while True: ...@@ -92,14 +95,14 @@ while True:
if t > 0: if t > 0:
y -= t y -= t
wukong.rect.y = y wukong.rect.y = y
t -= 2.3 t -= 1.7
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 30: if t <= 30:
y += t y += t
wukong.rect.y = y wukong.rect.y = y
t += 2.3 t += 1.7
else: else:
jumpState = "runing" jumpState = "runing"
t =30 t =30
......
This diff is collapsed. Click to expand it.
record.txt
View file @ 37648294
{"第1名": 4, "第2名": 2, "第3名": 1} {"第1名": 46, "第2名": 35, "第3名": 16}
\ No newline at end of file \ 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