当前位置:首页>python>Python实战项目之小游戏开发

Python实战项目之小游戏开发

  • 2026-03-27 17:17:53
Python实战项目之小游戏开发

一、整体说明

运行前请先安装 pygame:

bash  

pip install pygame

三个游戏统一使用:

- Python 3.8+

- Pygame 2.0+

- 面向过程 + 简单面向对象结合

- 注释详细,逻辑清晰,适合学习

二、游戏1:Python 消消乐(Match Three Game)

2.1 游戏思路与功能说明

消消乐核心规则:

1. 8×8 网格,随机生成不同颜色方块

2. 点击相邻两个方块交换位置

3. 横向/纵向 ≥3 个相同则消除,得分+10

4. 消除后上方方块下落,顶部补充新方块

5. 可无限游玩,实时显示分数

实现要点:

- 网格数据结构:二维列表  grid[y][x] 

- 鼠标点击检测、交换逻辑

- 匹配检测(横向、纵向)

- 消除动画、下落填充逻辑

- 分数系统

2.2 消消乐完整代码

python  

import pygame

import random

import sys

# ====================== 常量设置 ======================

WIDTH, HEIGHT = 600, 600

GRID_SIZE = 8

CELL_SIZE = WIDTH // GRID_SIZE

FPS = 60

# 颜色定义

WHITE = (255, 255, 255)

BLACK = (0, 0, 0)

RED = (255, 0, 0)

GREEN = (0, 255, 0)

BLUE = (0, 0, 255)

YELLOW = (255, 255, 0)

PURPLE = (255, 0, 255)

CYAN = (0, 255, 255)

COLORS = [RED, GREEN, BLUE, YELLOW, PURPLE, CYAN]

# ====================== 初始化 ======================

pygame.init()

screen = pygame.display.set_mode((WIDTH, HEIGHT))

pygame.display.set_caption("消消乐 - Python版")

clock = pygame.time.Clock()

font = pygame.font.SysFont(None, 40)

score = 0

selected = None

grid = [[random.choice(COLORS) for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)]

# ====================== 工具函数 ======================

def draw_grid():

    """绘制网格与方块"""

    for y in range(GRID_SIZE):

        for x in range(GRID_SIZE):

            color = grid[y][x]

            rect = (x * CELL_SIZE, y * CELL_SIZE, CELL_SIZE - 2, CELL_SIZE - 2)

            pygame.draw.rect(screen, color, rect)

def get_cell(pos):

    """通过鼠标坐标获取网格坐标"""

    x = pos[0] // CELL_SIZE

    y = pos[1] // CELL_SIZE

    if 0 <= x < GRID_SIZE and 0 <= y < GRID_SIZE:

        return (x, y)

    return None

def swap_cells(c1, c2):

    """交换两个格子颜色"""

    x1, y1 = c1

    x2, y2 = c2

    grid[y1][x1], grid[y2][x2] = grid[y2][x2], grid[y1][x1]

def is_adjacent(c1, c2):

    """判断是否相邻"""

    x1, y1 = c1

    x2, y2 = c2

    dx = abs(x1 - x2)

    dy = abs(y1 - y2)

    return (dx == 1 and dy == 0) or (dx == 0 and dy == 1)

def check_matches():

    """检查所有匹配并返回匹配位置"""

    matched = set()

    # 横向匹配

    for y in range(GRID_SIZE):

        for x in range(GRID_SIZE - 2):

            if grid[y][x] == grid[y][x+1] == grid[y][x+2] != None:

                matched.add((x, y))

                matched.add((x+1, y))

                matched.add((x+2, y))

    # 纵向匹配

    for x in range(GRID_SIZE):

        for y in range(GRID_SIZE - 2):

            if grid[y][x] == grid[y+1][x] == grid[y+2][x] != None:

                matched.add((x, y))

                matched.add((x, y+1))

                matched.add((x, y+2))

    return matched

def remove_matches(matched):

    """消除匹配方块"""

    global score

    if not matched:

        return False

    for (x, y) in matched:

        grid[y][x] = None

    score += 10 * len(matched)

    return True

def drop_blocks():

    """方块下落,顶部填充新方块"""

    for x in range(GRID_SIZE):

        col = [grid[y][x] for y in range(GRID_SIZE) if grid[y][x] is not None]

        new_col = [None] * (GRID_SIZE - len(col)) + col

        for y in range(GRID_SIZE):

            grid[y][x] = new_col[y]

    # 顶部补充

    for x in range(GRID_SIZE):

        for y in range(GRID_SIZE):

            if grid[y][x] is None:

                grid[y][x] = random.choice(COLORS)

# ====================== 主循环 ======================

running = True

while running:

    screen.fill(BLACK)

    clock.tick(FPS)

    # 事件处理

    for event in pygame.event.get():

        if event.type == pygame.QUIT:

            running = False

        if event.type == pygame.MOUSEBUTTONDOWN:

            cell = get_cell(pygame.mouse.get_pos())

            if cell:

                if selected is None:

                    selected = cell

                else:

                    if cell == selected:

                        selected = None

                    elif is_adjacent(selected, cell):

                        swap_cells(selected, cell)

                        matched = check_matches()

                        if not matched:

                            swap_cells(selected, cell)

                        selected = None

                    else:

                        selected = cell

    # 自动消除与下落

    while True:

        matched = check_matches()

        if not matched:

            break

        remove_matches(matched)

        drop_blocks()

    # 绘制

    draw_grid()

    score_text = font.render(f"Score: {score}", True, WHITE)

    screen.blit(score_text, (10, 10))

    pygame.display.flip()

pygame.quit()

sys.exit()

2.3 消消乐代码逐行详细解析

(1)库导入

python  

import pygame

import random

import sys

-  pygame :游戏窗口、图形、事件

-  random :随机生成颜色方块

-  sys :安全退出程序

(2)常量定义

屏幕尺寸 600×600,分为 8×8 网格,每个格子 75px。

定义 6 种鲜艳颜色,用于不同方块。

(3)初始化

- 初始化 pygame

- 创建窗口

- 设置标题、帧率、字体

- 初始化分数、选中状态、随机网格

(4)绘制网格  draw_grid() 

双层循环遍历 8×8 网格,每个格子绘制一个矩形,留出 1px 空隙形成网格线。

(5)鼠标点击转网格坐标  get_cell() 

将鼠标像素坐标除以格子大小,得到  x,y  索引,实现点击定位。

(6)交换与相邻判断

-  swap_cells :交换两个位置颜色

-  is_adjacent :只允许上下左右相邻交换,符合消消乐规则

(7)匹配检测  check_matches() 

分别检查:

- 横向连续 3 个相同

- 纵向连续 3 个相同

使用集合避免重复记录同一格子。

(8)消除与下落

-  remove_matches :将匹配方块设为  None 

-  drop_blocks :

- 提取当前列非空方块

- 下方对齐,上方补空

- 空位置随机生成新颜色

(9)主循环逻辑

1. 事件监听:退出、鼠标点击

2. 选中第一个格子 → 选中第二个相邻格子 → 交换

3. 若交换后无匹配,则撤销交换

4. 循环检测匹配 → 消除 → 下落 → 补充

5. 绘制画面与分数

三、游戏2:Python 贪吃蛇(Snake Game)

3.1 游戏规则与设计思路

经典贪吃蛇规则:

1. 蛇由方块组成,初始长度 3

2. 方向键控制上下左右

3. 吃到食物身体变长,分数+10

4. 撞墙或撞到自身 → 游戏结束

5. 食物随机生成,不与蛇身重叠

技术结构:

- 蛇身体:列表  [(x,y), (x,y), ...] 

- 方向控制:上下左右状态变量

- 碰撞检测:边界 + 自身

- 食物随机生成

3.2 贪吃蛇完整代码

python  

import pygame

import random

import sys

# ====================== 常量 ======================

WIDTH, HEIGHT = 600, 600

BLOCK_SIZE = 20

GRID_W = WIDTH // BLOCK_SIZE

GRID_H = HEIGHT // BLOCK_SIZE

FPS = 10

WHITE = (255,255,255)

BLACK = (0,0,0)

RED = (255,0,0)

GREEN = (0,255,0)

BLUE = (0,0,255)

# ====================== 初始化 ======================

pygame.init()

screen = pygame.display.set_mode((WIDTH, HEIGHT))

pygame.display.set_caption("贪吃蛇 - Python版")

clock = pygame.time.Clock()

font = pygame.font.SysFont(None, 40)

# ====================== 蛇与食物 ======================

def new_food(snake):

    while True:

        x = random.randint(0, GRID_W-1) * BLOCK_SIZE

        y = random.randint(0, GRID_H-1) * BLOCK_SIZE

        if (x, y) not in snake:

            return (x, y)

snake = [(12*BLOCK_SIZE, 15*BLOCK_SIZE),

         (13*BLOCK_SIZE, 15*BLOCK_SIZE),

         (14*BLOCK_SIZE, 15*BLOCK_SIZE)]

dir_x, dir_y = -1, 0

food = new_food(snake)

score = 0

game_over = False

# ====================== 主循环 ======================

while True:

    screen.fill(BLACK)

    for event in pygame.event.get():

        if event.type == pygame.QUIT:

            pygame.quit()

            sys.exit()

        if event.type == pygame.KEYDOWN and not game_over:

            if event.key == pygame.K_UP and dir_y == 0:

                dir_x, dir_y = 0, -1

            elif event.key == pygame.K_DOWN and dir_y == 0:

                dir_x, dir_y = 0, 1

            elif event.key 

elif event.key == pygame.K_DOWN and dir_y == 0:

                dir_x, dir_y = 0, 1

            elif event.key == pygame.K_LEFT and dir_x == 0:

                dir_x, dir_y = -1, 0

            elif event.key == pygame.K_RIGHT and dir_x == 0:

                dir_x, dir_y = 1, 0

    if not game_over:

        # 新头部

        head_x, head_y = snake[0]

        new_head = (head_x + dir_x * BLOCK_SIZE, head_y + dir_y * BLOCK_SIZE)

        # 撞墙

        if (new_head[0] < 0 or new_head[0] >= WIDTH or

            new_head[1] < 0 or new_head[1] >= HEIGHT):

            game_over = True

        # 撞自己

        if new_head in snake:

            game_over = True

        snake.insert(0, new_head)

        # 吃食物

        if new_head == food:

            score += 10

            food = new_food(snake)

        else:

            snake.pop()

    # 绘制蛇

    for (x, y) in snake:

        pygame.draw.rect(screen, GREEN, (x, y, BLOCK_SIZE-1, BLOCK_SIZE-1))

    # 绘制食物

    fx, fy = food

    pygame.draw.rect(screen, RED, (fx, fy, BLOCK_SIZE-1, BLOCK_SIZE-1))

    # 分数

    score_text = font.render(f"Score: {score}", True, WHITE)

    screen.blit(score_text, (10, 10))

    # 结束文字

    if game_over:

        go_text = font.render("GAME OVER", True, RED)

        screen.blit(go_text, (WIDTH//2 - 80, HEIGHT//2))

    pygame.display.update()

    clock.tick(FPS)

3.3 贪吃蛇详细解析

(1)核心数据结构

蛇身体是坐标列表,头部在最前,每帧更新:

- 新增头部

- 没吃到食物就删除尾部 → 移动

- 吃到食物保留尾部 → 变长

(2)方向控制

禁止 180° 掉头:

- 向上时不能直接向下

- 向左时不能直接向右

使游戏更合理。

(3)碰撞判断

- 边界碰撞:x/y 超出窗口范围

- 自身碰撞:新头部坐标在身体列表中

(4)食物生成

 new_food  保证食物不会出现在蛇身上,避免无法吃到的问题。

(5)绘制逻辑

- 蛇身绿色矩形

- 食物红色

- 实时分数

- 结束时显示 GAME OVER

四、游戏3:Python 俄罗斯方块(Tetris)

4.1 俄罗斯方块规则与结构

规则:

1. 7 种经典方块(I、O、T、L、J、S、Z)

2. 左右移动、加速下落、旋转

3. 触底或顶到其他方块则固定

4. 满行消除,得分增加

5. 方块触顶 → 游戏结束

结构:

- 游戏区域:10×20 网格

- 形状定义:二维列表矩阵

- 旋转算法:矩阵转置 + 翻转

- 消行检测与计分

4.2 俄罗斯方块完整代码

python  

import pygame

import random

# ====================== 常量 ======================

WIDTH = 300

HEIGHT = 600

BLOCK = 30

COLS = WIDTH // BLOCK

ROWS = HEIGHT // BLOCK

WHITE = (255,255,255)

BLACK = (0,0,0)

COLORS = [(0,255,255),(255,255,0),(128,0,128),(255,165,0),(0,0,255),(0,255,0),(255,0,0)]

# 7种方块形状

SHAPES = [

    [[1,1,1,1]],

    [[1,1],[1,1]],

    [[0,1,0],[1,1,1]],

    [[0,0,1],[1,1,1]],

    [[1,0,0],[1,1,1]],

    [[0,1,1],[1,1,0]],

    [[1,1,0],[0,1,1]]

]

# ====================== 初始化 ======================

pygame.init()

screen = pygame.display.set_mode((WIDTH, HEIGHT))

pygame.display.set_caption("俄罗斯方块 - Python版")

clock = pygame.time.Clock()

fall_time = 0

fall_speed = 0.5

font = pygame.font.SysFont(None, 40)

# 游戏场

grid = [[0 for _ in range(COLS)] for _ in range(ROWS)]

score = 0

game_over = False

# 当前方块

class Piece:

    def __init__(self):

        self.shape = random.choice(SHAPES)

        self.color = random.choice(COLORS)

        self.x = COLS//2 - len(self.shape[0])//2

        self.y = 0

    def rotate(self):

        self.shape = [list(row) for row in zip(*self.shape[::-1])]

current = Piece()

# ====================== 碰撞检测 ======================

def check_collision(piece, grid):

    shape = piece.shape

    for y, row in enumerate(shape):

        for x, cell in enumerate(row):

            if cell:

                abs_x = piece.x + x

                abs_y = piece.y + y

                if abs_x < 0 or abs_x >= COLS or abs_y >= ROWS:

                    return True

                if abs_y >=0 and grid[abs_y][abs_x]:

                    return True

    return False

# ====================== 消行 ======================

def clear_lines(grid):

    global score

    new_grid = []

    lines_cleared = 0

    for row in grid:

        if all(row):

            lines_cleared +=1

        else:

            new_grid.append(row)

    score += lines_cleared * 100

    return [[0]*COLS for _ in range(lines_cleared)] + new_grid

# ====================== 固定方块 ======================

def lock_piece(piece, grid):

    shape = piece.shape

    for y, row in enumerate(shape):

        for x, cell in enumerate(row):

            if cell:

                grid[piece.y + y][piece.x + x] = piece.color

# ====================== 绘制 ======================

def draw_grid(screen, grid):

    for y in range(ROWS):

        for x in range(COLS):

            color = grid[y][x]

            if color:

                pygame.draw.rect(screen, color, (x*BLOCK, y*BLOCK, BLOCK-1, BLOCK-1))

def draw_piece(screen, piece):

    shape = piece.shape

    for y, row in enumerate(shape):

        for x, cell in enumerate(row):

            if cell:

                abs_x = piece.x + x

                abs_y = piece.y + y

                pygame.draw.rect(screen, piece.color, (abs_x*BLOCK, abs_y*BLOCK, BLOCK-1, BLOCK-1))

# ====================== 主循环 ======================

while True:

    screen.fill(BLACK)

    dt = clock.tick(60) / 1000

    fall_time += dt

    # 事件

    for event in pygame.event.get():

        if event.type == pygame.QUIT:

            pygame.quit()

            exit()

        if not game_over and event.type == pygame.KEYDOWN:

            if event.key == pygame.K_LEFT:

                current.x -=1

                if check_collision(current, grid):

                    current.x +=1

            elif event.key == pygame.K_RIGHT:

                current.x +=1

                if check_collision(current, grid):

                    current.x -=1

            elif event.key == pygame.K_DOWN:

                current.y +=1

                if check_collision(current, grid):

                    current.y -=1

                    lock_piece(current, grid)

                    grid = clear_lines(grid)

                    current = Piece()

                    if check_collision(current, grid):

                        game_over = True

            elif event.key == pygame.K_UP:

                current.rotate()

                if check_collision(current, grid):

                    current.rotate()

                    current.rotate()

                    current.rotate()

    # 自动下落

    if not game_over and fall_time >= fall_speed:

        fall_time = 0

        current.y +=1

        if check_collision(current, grid):

            current.y -=1

            lock_piece(current, grid)

            grid = clear_lines(grid)

            current = Piece()

            if check_collision(current, grid):

                game_over = True

    # 绘制

    draw_grid(screen, grid)

    draw_piece(screen, current)

    # 分数

    score_text = font.render(f"{score}", True, WHITE)

    screen.blit(score_text, (10,10))

    # 结束

    if game_over:

        go = font.render("GAME OVER", True, WHITE)

        screen.blit(go, (WIDTH//2 - 70, HEIGHT//2))

    pygame.display.update()

4.3 俄罗斯方块详细解析

(1)形状与旋转

7 种形状用 0/1 矩阵表示。

旋转使用:

plaintext  

转置 + 逆序行

实现经典旋转效果。

(2)碰撞检测

检查:

- 是否超出左右边界

- 是否超出底部

- 是否与已固定方块重叠

(3)消行逻辑

遍历每一行,若全部非空则消除,顶部补充空行。

(4)下落逻辑

定时自动下落,触底则锁定,生成新方块。

新方块一出世就碰撞 → 游戏结束。

(5)控制

- 左右移动

- 下键加速

- 上键旋转

- 自动下落

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-28 02:29:54 HTTP/2.0 GET : https://f.mffb.com.cn/a/483375.html
  2. 运行时间 : 0.220773s [ 吞吐率:4.53req/s ] 内存消耗:4,637.79kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8088b4edc4e0cfab801aa8f88422553d
  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.000894s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001339s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005097s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.004589s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001507s ]
  6. SELECT * FROM `set` [ RunTime:0.021471s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001839s ]
  8. SELECT * FROM `article` WHERE `id` = 483375 LIMIT 1 [ RunTime:0.001087s ]
  9. UPDATE `article` SET `lasttime` = 1774636194 WHERE `id` = 483375 [ RunTime:0.004190s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.007768s ]
  11. SELECT * FROM `article` WHERE `id` < 483375 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001248s ]
  12. SELECT * FROM `article` WHERE `id` > 483375 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001119s ]
  13. SELECT * FROM `article` WHERE `id` < 483375 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003022s ]
  14. SELECT * FROM `article` WHERE `id` < 483375 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.008603s ]
  15. SELECT * FROM `article` WHERE `id` < 483375 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002438s ]
0.224535s