当前位置:首页>python>【Python钢琴节奏大师·第9讲】游戏系统篇-状态管理与生命值机制设计

【Python钢琴节奏大师·第9讲】游戏系统篇-状态管理与生命值机制设计

  • 2026-03-29 10:35:55
【Python钢琴节奏大师·第9讲】游戏系统篇-状态管理与生命值机制设计

🎹 Python钢琴节奏大师 · 第9章

系列:Python钢琴节奏大师:从零到游戏开发实战[1]章节:第9章 / 共12章标题:游戏系统篇-状态管理与生命值机制设计上一章:第8章-节奏游戏篇[2]下一章:第10章-视觉美化篇[3]


计分与结束——真正的游戏

今日目标:完善计分系统,添加游戏结束判定,实现重新开始功能,完成游戏状态管理。

💡 本章核心:实现完整的游戏系统,让游戏有始有终


🎹 效果预览

完成本篇学习后,你的游戏会有:

  • 开始菜单界面
  • 生命值系统(错过音符扣血)
  • 游戏结束判定
  • 重新开始功能
  • 最终成绩展示
┌────────────────────────────────────┐│                                    ││         🎹 钢琴节奏大师 🎹          ││                                    ││         最高分:5000               ││                                    ││      [按空格键开始游戏]            ││                                    │└────────────────────────────────────┘              ↓         游戏进行中              ↓┌────────────────────────────────────┐│  分数:3250  生命:❤️❤️❤️💔💔       ││                                    ││         游戏结束!                 ││                                    ││      最终得分:3250                ││      最高连击:45                  ││      准确率:87%                   ││                                    ││    [按R重新开始]  [按Q退出]        ││                                    │└────────────────────────────────────┘

🤔 什么是游戏状态?

游戏通常有多个"状态":

状态
说明
显示内容
MENU
菜单/开始界面
标题、最高分、开始按钮
PLAYING
游戏进行中
音符、琴键、分数、生命
PAUSED
暂停
暂停菜单
GAME_OVER
游戏结束
最终成绩、重新开始选项

为什么要分状态?

  • 不同状态显示不同内容
  • 不同状态响应不同操作
  • 逻辑更清晰,代码更好维护

📝 第一步:定义游戏状态

# 游戏状态常量STATE_MENU = 0STATE_PLAYING = 1STATE_PAUSED = 2STATE_GAME_OVER = 3# 当前状态current_state = STATE_MENU

使用枚举(更专业)

from enum import EnumclassGameState(Enum):    MENU = 0    PLAYING = 1    PAUSED = 2    GAME_OVER = 3current_state = GameState.MENU

📝 第二步:添加生命值系统

生命值的实现

# 游戏参数MAX_LIVES = 5# 最大生命值lives = MAX_LIVES      # 当前生命值# 当错过音符时if note.y > JUDGMENT_LINE + JUDGMENT_RANGE andnot note.hit:    lives -= 1# 扣一滴血    combo = 0# 连击中断if lives <= 0:        current_state = STATE_GAME_OVER  # 生命为0,游戏结束

显示生命值

defdraw_lives(screen, lives):"""绘制生命值"""    heart_full = "❤️"# 满血    heart_empty = "💔"# 空血    lives_text = ""for i inrange(MAX_LIVES):if i < lives:            lives_text += heart_fullelse:            lives_text += heart_empty    text = font.render(f"生命:{lives_text}"True, WHITE)    screen.blit(text, (20100))

📝 第三步:菜单界面

菜单显示

defdraw_menu(screen):"""绘制菜单界面"""    screen.fill((303050))  # 深蓝紫色背景# 标题    title = big_font.render("🎹 钢琴节奏大师 🎹"True, (255200100))    screen.blit(title, (SCREEN_WIDTH//2 - title.get_width()//2150))# 最高分    high_score_text = font.render(f"最高分:{high_score}"True, WHITE)    screen.blit(high_score_text, (SCREEN_WIDTH//2 - high_score_text.get_width()//2250))# 操作说明    instructions = ["操作说明:","A S D F G H J - 白键(do re mi fa sol la si)","W E T Y U - 黑键(#do #re #fa #sol #la)","","按空格键开始游戏"    ]    y = 350for line in instructions:        text = small_font.render(line, True, (200200200))        screen.blit(text, (SCREEN_WIDTH//2 - text.get_width()//2, y))        y += 30

菜单事件处理

if current_state == STATE_MENU:if event.type == pygame.KEYDOWN:if event.key == pygame.K_SPACE:            reset_game()           # 重置游戏            current_state = STATE_PLAYING

📝 第四步:游戏结束界面

显示最终成绩

defdraw_game_over(screen):"""绘制游戏结束界面"""# 半透明黑色遮罩    overlay = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))    overlay.fill(BLACK)    overlay.set_alpha(200)  # 透明度    screen.blit(overlay, (00))# 游戏结束标题    title = big_font.render("游戏结束!"True, (255100100))    screen.blit(title, (SCREEN_WIDTH//2 - title.get_width()//2150))# 成绩统计    stats = [f"最终得分:{score}",f"最高连击:{max_combo}",f"击中次数:{hits}",f"错过次数:{misses}",f"准确率:{hits/(hits+misses)*100:.1f}%"if (hits+misses) > 0else"准确率:0%"    ]    y = 250for stat in stats:        text = font.render(stat, True, WHITE)        screen.blit(text, (SCREEN_WIDTH//2 - text.get_width()//2, y))        y += 40# 操作提示    hint = small_font.render("按 R 重新开始  按 Q 退出"True, (200200200))    screen.blit(hint, (SCREEN_WIDTH//2 - hint.get_width()//2500))

更新最高分

# 最高分记录(保存在内存中,游戏重启会重置)high_score = 0defupdate_high_score():"""更新最高分"""global high_scoreif score > high_score:        high_score = score

📝 第五步:重置游戏

defreset_game():"""重置游戏状态"""global score, combo, max_combo, hits, misses, livesglobal notes, spawn_timer, white_key_pressed    score = 0    combo = 0    max_combo = 0    hits = 0    misses = 0    lives = MAX_LIVES    notes = []    spawn_timer = 0    white_key_pressed = [False] * WHITE_KEY_COUNT

🎯 完整代码

import pygameimport randompygame.init()pygame.mixer.init()# 窗口SCREEN_WIDTH, SCREEN_HEIGHT = 800600screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))pygame.display.set_caption("钢琴节奏大师 - 完整版")clock = pygame.time.Clock()# 颜色BLACK, WHITE, GRAY, DARK_GRAY = (0,0,0), (255,255,255), (200,200,200), (50,50,50)YELLOW, NOTE_COLOR, RED = (255,255,0), (255,100,100), (255,100,100)# 游戏状态STATE_MENU = 0STATE_PLAYING = 1STATE_PAUSED = 2STATE_GAME_OVER = 3current_state = STATE_MENU# 钢琴键参数WHITE_KEY_WIDTH, WHITE_KEY_HEIGHT = 80300WHITE_KEY_COUNT = 7START_X, START_Y = 100350JUDGMENT_LINE = START_YJUDGMENT_RANGE = 30# 键盘映射WHITE_KEY_MAPPING = {    pygame.K_a: 0, pygame.K_s: 1, pygame.K_d: 2,    pygame.K_f: 3, pygame.K_g: 4, pygame.K_h: 5, pygame.K_j: 6,}WHITE_KEY_NAMES = ["do""re""mi""fa""sol""la""si"]WHITE_KEY_CHARS = ["A""S""D""F""G""H""J"]# 音符类classNote:def__init__(self, lane):self.lane = laneself.y = -50self.speed = 5self.active = Trueself.hit = Falsedefupdate(self):self.y += self.speedifself.y > SCREEN_HEIGHT + 50:self.active = Falsedefdraw(self, screen):ifself.active:            x = START_X + self.lane * WHITE_KEY_WIDTH + WHITE_KEY_WIDTH // 2            pygame.draw.circle(screen, NOTE_COLOR, (int(x), int(self.y)), 15)            pygame.draw.line(screen, NOTE_COLOR, (int(x), int(self.y)), (int(x), int(self.y)-40), 4)# 字体font = pygame.font.SysFont(None36)big_font = pygame.font.SysFont(None72)small_font = pygame.font.SysFont(None24)# 游戏状态变量score = combo = max_combo = hits = misses = 0lives = 5MAX_LIVES = 5high_score = 0notes = []spawn_timer = 0SPAWN_INTERVAL = 45white_key_pressed = [False] * WHITE_KEY_COUNT# 辅助函数defreset_game():global score, combo, max_combo, hits, misses, lives, notes, spawn_timer, white_key_pressed    score = combo = max_combo = hits = misses = 0    lives = MAX_LIVES    notes = []    spawn_timer = 0    white_key_pressed = [False] * WHITE_KEY_COUNTdefcheck_hit(lane):for note in notes:if note.active andnot note.hit and note.lane == lane:            distance = abs(note.y - JUDGMENT_LINE)if distance <= JUDGMENT_RANGE:                note.hit, note.active = TrueFalsereturnTrue, distancereturnFalseNonedefadd_score(distance):global score, combo, hits, max_comboif distance <= 10:        points, combo = 100, combo + 1        judgment = "Perfect!"elif distance <= 20:        points, combo = 80, combo + 1        judgment = "Great!"elif distance <= 30:        points, combo = 50, combo + 1        judgment = "Good"else:        points, combo = 00        judgment = "Miss"    score += points + combo * 5    hits += 1    max_combo = max(max_combo, combo)return judgment, pointsdefspawn_note():    notes.append(Note(random.randint(0, WHITE_KEY_COUNT - 1)))defdraw_menu():    screen.fill((303050))    title = big_font.render("钢琴节奏大师"True, (255200100))    screen.blit(title, (SCREEN_WIDTH//2 - title.get_width()//2150))    high = font.render(f"最高分:{high_score}"True, WHITE)    screen.blit(high, (SCREEN_WIDTH//2 - high.get_width()//2250))    hint = small_font.render("按空格键开始游戏"True, (200200200))    screen.blit(hint, (SCREEN_WIDTH//2 - hint.get_width()//2350))defdraw_game_over():    overlay = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))    overlay.fill(BLACK)    overlay.set_alpha(200)    screen.blit(overlay, (00))    title = big_font.render("游戏结束!"True, RED)    screen.blit(title, (SCREEN_WIDTH//2 - title.get_width()//2150))    stats = [f"最终得分:{score}",f"最高连击:{max_combo}",f"准确率:{hits/(hits+misses)*100:.1f}%"if (hits+misses) > 0else"准确率:0%"    ]    y = 250for stat in stats:        text = font.render(stat, True, WHITE)        screen.blit(text, (SCREEN_WIDTH//2 - text.get_width()//2, y))        y += 50    hint = small_font.render("按 R 重新开始  按 Q 退出"True, (200200200))    screen.blit(hint, (SCREEN_WIDTH//2 - hint.get_width()//2500))defdraw_lives():    lives_text = f"生命:{'❤️' * lives}{'💔' * (MAX_LIVES - lives)}"    text = font.render(lives_text, True, WHITE)    screen.blit(text, (20100))# 游戏循环running = Truejudgment_text = ""judgment_timer = 0while running:    clock.tick(60)# 事件处理for event in pygame.event.get():if event.type == pygame.QUIT:            running = Falseif current_state == STATE_MENU:if event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE:                reset_game()                current_state = STATE_PLAYINGelif current_state == STATE_PLAYING:if event.type == pygame.KEYDOWN:if event.key == pygame.K_ESCAPE:                    current_state = STATE_MENUelif event.key in WHITE_KEY_MAPPING:                    idx = WHITE_KEY_MAPPING[event.key]                    white_key_pressed[idx] = True                    hit, dist = check_hit(idx)if hit:                        j, p = add_score(dist)                        judgment_text, judgment_timer = f"{j} +{p}"30else:                        judgment_text, judgment_timer = "空按"20elif event.type == pygame.KEYUP:if event.key in WHITE_KEY_MAPPING:                    white_key_pressed[WHITE_KEY_MAPPING[event.key]] = Falseelif current_state == STATE_GAME_OVER:if event.type == pygame.KEYDOWN:if event.key == pygame.K_r:                    reset_game()                    current_state = STATE_PLAYINGelif event.key == pygame.K_q:                    running = False# 更新if current_state == STATE_PLAYING:        spawn_timer += 1if spawn_timer >= SPAWN_INTERVAL:            spawn_note()            spawn_timer = 0for note in notes:            note.update()if note.active and note.y > JUDGMENT_LINE + JUDGMENT_RANGE andnot note.hit:                lives -= 1                combo = 0                misses += 1                judgment_text, judgment_timer = "Miss!"30                note.active = Falseif lives <= 0:                    current_state = STATE_GAME_OVERif score > high_score:                        high_score = score        notes = [n for n in notes if n.active]        judgment_timer = max(0, judgment_timer - 1)if judgment_timer == 0:            judgment_text = ""# 绘制    screen.fill(DARK_GRAY)if current_state == STATE_MENU:        draw_menu()elif current_state == STATE_PLAYING:# 判定线        pygame.draw.line(screen, YELLOW, (START_X, JUDGMENT_LINE),                        (START_X + WHITE_KEY_COUNT * WHITE_KEY_WIDTH, JUDGMENT_LINE), 3)# 音符for note in notes:            note.draw(screen)# 白键for i inrange(WHITE_KEY_COUNT):            x = START_X + i * WHITE_KEY_WIDTH            color = YELLOW if white_key_pressed[i] else WHITE            pygame.draw.rect(screen, color, (x, START_Y, WHITE_KEY_WIDTH, WHITE_KEY_HEIGHT))            pygame.draw.rect(screen, GRAY, (x, START_Y, WHITE_KEY_WIDTH, WHITE_KEY_HEIGHT), 1)            screen.blit(small_font.render(WHITE_KEY_CHARS[i], True, DARK_GRAY), (x + 35, START_Y + 10))            screen.blit(font.render(WHITE_KEY_NAMES[i], True, BLACK), (x + 25, START_Y + 250))# UI        screen.blit(font.render(f"分数:{score}"True, WHITE), (2020))        screen.blit(font.render(f"连击:{combo}"True, WHITE), (2060))        draw_lives()if combo > 0:            screen.blit(big_font.render(str(combo), True, YELLOW), (SCREEN_WIDTH//2 - 2080))if judgment_text:            screen.blit(big_font.render(judgment_text, True, YELLOW), (SCREEN_WIDTH//2 - 100150))elif current_state == STATE_GAME_OVER:# 先绘制游戏画面        pygame.draw.line(screen, YELLOW, (START_X, JUDGMENT_LINE),                        (START_X + WHITE_KEY_COUNT * WHITE_KEY_WIDTH, JUDGMENT_LINE), 3)for note in notes:            note.draw(screen)for i inrange(WHITE_KEY_COUNT):            x = START_X + i * WHITE_KEY_WIDTH            pygame.draw.rect(screen, WHITE, (x, START_Y, WHITE_KEY_WIDTH, WHITE_KEY_HEIGHT))# 再绘制结束界面        draw_game_over()    pygame.display.flip()pygame.quit()

🔍 核心概念

1. 游戏状态管理

if current_state == STATE_MENU:# 显示菜单elif current_state == STATE_PLAYING:# 游戏进行中elif current_state == STATE_GAME_OVER:# 游戏结束

2. 生命值系统

lives = MAX_LIVES  # 初始满血# 受伤lives -= 1# 检查死亡if lives <= 0:    game_over()

3. 最高分记录

if score > high_score:    high_score = score  # 更新最高分

🎨 动手改造

改造1:添加暂停功能

if event.key == pygame.K_SPACE:if current_state == STATE_PLAYING:        current_state = STATE_PAUSEDelif current_state == STATE_PAUSED:        current_state = STATE_PLAYING

改造2:难度递增

# 随着分数增加,速度加快note.speed = 5 + score // 1000

改造3:保存最高分到文件

# 保存withopen("highscore.txt""w"as f:    f.write(str(high_score))# 读取try:withopen("highscore.txt""r"as f:        high_score = int(f.read())except:    high_score = 0

❓ 常见问题

Q1:游戏结束后无法重新开始

检查reset_game() 函数是否正确重置所有变量?

Q2:生命值显示异常

检查lives 是否可能变成负数?添加保护:lives = max(0, lives)

Q3:状态切换没反应

检查:事件处理是否在正确的状态分支中?

Q4:最高分没保存

说明:当前版本最高分只在内存中,重启游戏会重置。


🎉 恭喜你完成第9课!

今天你已经:

  • ✅ 学会了游戏状态管理
  • ✅ 实现了生命值系统
  • ✅ 完成了游戏结束判定
  • ✅ 添加了重新开始功能

你的钢琴游戏现在是一个完整的游戏了!


本系列文章面向零基础中小学生,每篇都有详细步骤和配图说明。遇到问题欢迎在评论区留言!关注回复“钢琴”免费获取源代码下载地址。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-29 18:10:35 HTTP/2.0 GET : https://f.mffb.com.cn/a/483776.html
  2. 运行时间 : 0.087631s [ 吞吐率:11.41req/s ] 内存消耗:4,854.39kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=5c500deb358c65940adb0a7d382ad527
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000405s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000618s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000259s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000277s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000478s ]
  6. SELECT * FROM `set` [ RunTime:0.000221s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000504s ]
  8. SELECT * FROM `article` WHERE `id` = 483776 LIMIT 1 [ RunTime:0.002748s ]
  9. UPDATE `article` SET `lasttime` = 1774779035 WHERE `id` = 483776 [ RunTime:0.003680s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000373s ]
  11. SELECT * FROM `article` WHERE `id` < 483776 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000665s ]
  12. SELECT * FROM `article` WHERE `id` > 483776 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000555s ]
  13. SELECT * FROM `article` WHERE `id` < 483776 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002712s ]
  14. SELECT * FROM `article` WHERE `id` < 483776 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001151s ]
  15. SELECT * FROM `article` WHERE `id` < 483776 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001382s ]
0.090457s