当前位置:首页>python>用Python和Pygame打造经典坦克大战:一次完整的游戏开发实践

用Python和Pygame打造经典坦克大战:一次完整的游戏开发实践

  • 2026-04-20 13:51:24
用Python和Pygame打造经典坦克大战:一次完整的游戏开发实践
用Python复刻童年经典!我写了300行代码,带你把坦克大战搬上电脑屏幕🚀

还记得那个暑假,和小伙伴们挤在电视机前,为了一局坦克大战争得面红耳赤的日子吗?今天,我用代码把它“复活”了!

周末心血来潮,翻出那台老旧的笔记本电脑,敲下了300行Python代码。当蓝色小坦克在屏幕上移动,向红色敌人开火的那一刻,童年的记忆瞬间涌上心头。
🎮 先睹为快:你的坦克已就位!
运行效果简直不要太爽:蓝色坦克是你,红色是AI敌人,棕色墙壁可打穿,灰色墙壁绕道走。WASD控制移动,空格键发射炮弹——弹药只有20发,省着点用!
游戏界面简洁直观,左上角实时显示你的分数、当前关卡,右上角是弹药和敌人数量。最贴心的是,你的生命值就显示在坦克头顶,三个小红心清清楚楚。
💡 为什么我要做这个项目?
说实话,最初只是手痒想写点小游戏。但当我深入思考,发现这个坦克大战项目简直是Python入门到进阶的完美练手项目
它涵盖了:
基础语法(类、函数、循环)
面向对象编程(四个核心类)
游戏开发核心概念(游戏循环、碰撞检测、状态管理)
实用库应用(Pygame)
最重要的是——它真的好玩!写代码最怕枯燥,而这个项目让你在玩中学习,在成就感中进步。
🔧 技术揭秘:代码可以这么优雅
让我自豪的是,这个项目的代码结构清晰得像教科书:
四大核心类,各司其职
Tank类- 坦克的“大脑”和“身体”
Bullet类- 子弹的飞行轨迹
Wall类- 墙壁的坚固程度
Game类- 整个游戏的“总指挥”
敌人的AI虽然简单,但很有灵性

敌人会“随机”决定往哪走

move_choice = random.randint(0, 30)

约3%的几率改变方向

还会“看心情”开火

if random.random() < 0.02:

“嘿,吃我一炮!”

return self.fire()
碰撞检测真实自然
坦克不能穿墙,子弹打到墙会消失,打到敌人就加分——所有互动都有模有样,玩起来手感流畅。
🎯 三个关卡,难度递进,挑战十足
游戏设计了精心调整的难度曲线:
第一关:3个敌人,让你熟悉操作
第二关:5个敌人,开始需要策略
第三关:7个敌人,真正的挑战来了!
每过一关都有奖励
弹药回满(又可以突突突了!)
血量回复1点(最多3点)
敌人更多,战场更刺激
🚀 手把手教你:5分钟从安装到开玩
第一步:安装必备工具(就一行命令!)
pip install pygame
第二步:复制用户提供的完整代码,保存为tank_game.py
第三步:运行游戏!
python tank_game.py
第四步:开始战斗!记住:
WASD或方向键移动
空格键射击(只有20发子弹!)
目标是消灭所有红色敌人
小心别被击中,你只有3条命
✨ 游戏彩蛋与设计巧思
弹药限制:不能无脑突突突,必须有策略地开火
墙壁系统:棕色墙可破坏,创造新路线;灰色墙永久,必须绕行
AI行为:敌人移动有随机性,但射击有冷却时间,不会太过分
视觉反馈:击中敌人有明显效果,玩起来手感扎实
💪 为什么你应该试试这个项目?
如果你是新⼿:这是绝佳的Python练手项目,代码结构清晰,注释详细
如果你是老鸟:可以在此基础上扩展,比如:
增加特殊道具系统(弹药包、护盾、加速)
设计Boss坦克,有特殊攻击模式
实现双人同屏对战,和朋友一起玩
开发关卡编辑器,创造自己的地图
如果你只是怀旧:这就是为你准备的!熟悉的玩法,现代的实现
📈 小编亲测:从“看代码”到“改代码”的成长之路
我最开始只是运行了别人写的版本。玩了几局后,手痒开始修改:
第一次修改:把弹药从20发改成30发——瞬间感觉自己是土豪
第二次修改:调整敌人移动速度,让游戏更容易
第三次修改:给自己加了“无敌模式”(测试用,不推荐长期开)
每一次修改,都让我对代码理解更深一层。从“这行代码干嘛的”到“我想让游戏怎样”,这种掌控感,正是编程最大的乐趣。
🎁 福利时间:几个实用小技巧
高分秘籍
贴着墙走相对安全
先打穿关键墙壁,创造有利地形
注意敌人子弹是红色的,提前预判
合理规划弹药,别一开始就打光
调试乐趣
想调整游戏难度?直接改代码里的几个数字:
觉得太难?把ENEMY_FIRE_RATE = 0.02改成0.01
想更刺激?把PLAYER_SPEED = 4改成5
弹药不够?把MAX_AMMO = 20改成30
进阶挑战
尝试添加这些功能(代码基础已打好):
计分系统:连杀奖励、时间奖励
武器升级:散弹、穿甲弹、跟踪弹
地形元素:河流、草丛、冰面
🌟 写在最后:代码不只是代码
这个坦克大战项目,对我而言不只是300行Python代码。它是:
一次童年回忆的数字重现
一次完整的游戏开发实践
一个可玩可改的编程教材
一份送给同样热爱编程的你的礼物
最让我感动的时刻,是看到朋友运行这个游戏时眼里的光——那种“哇,这居然是你写的”的惊喜,是任何赞美都比不上的成就感。
🎉 立即行动,开动你的坦克!
复制用户提供的代码,保存为tank_game.py
运行这行命令
python tank_game.py
开始你的坦克指挥官生涯
遇到问题?在评论区留言,咱们一起解决。做出酷炫的修改?一定分享出来,让更多人看到你的创意。
游戏的世界,因代码而生动;编程的乐趣,在创造中永恒。你的坦克,已经启动!🚀💥

小编提问:你第一次成功运行这个坦克大战时,是什么感觉?在评论区分享你的故事,点赞最高的三位朋友,我将分享更多Python游戏开发的小技巧!⬇️
P.S.如果卡关了……偷偷说,可以在代码里给自己“开个小灶”。不过,自己挑战过关的成就感,才是最甜的胜利果实,不是吗?😉
代码如下:
importpygame
importrandom
importmath
importsys
#初始化Pygamepygame.init()
#游戏窗口设置WIDTH, HEIGHT =800,600screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Tank Battle")
#颜色定义BLACK = (0,0,0)
WHITE = (255,255,255)
RED = (255,50,50)
GREEN = (50,255,50)
BLUE = (50,100,255)
YELLOW = (255,255,50)
GRAY = (150,150,150)
BROWN = (165,42,42)
DARK_GREEN = (0,100,0)
#游戏常量FPS =60PLAYER_SPEED =4BULLET_SPEED =8ENEMY_SPEED =2ENEMY_FIRE_RATE =0.02#每帧敌人开火的概率PLAYER_FIRE_RATE =15#玩家发射子弹的最小帧间隔WALL_SIZE =30GRID_SIZE =20MAX_ENEMIES =5MAX_AMMO =20ENEMY_RESPAWN_TIME =300#敌人重生时间(帧)classTank:
def__init__(self,x,y,color,is_player=False):
self.x =xself.y =yself.color =colorself.width =40self.height =40self.direction =0

0:上, 1:右, 2:下, 3:左self.is_player =is_playerself.health =3ifis_playerelse1self.cooldown =0self.alive =Trueself.speed = PLAYER_SPEEDifis_playerelseENEMY_SPEED

defmove(self,dx,dy,walls):
#计算新位置new_x=self.x +dxnew_y=self.y +dy#创建坦克的矩形tank_rect= pygame.Rect(new_x,new_y,self.width,self.height)
#检查是否与墙壁碰撞can_move=Trueforwallinwalls:
iftank_rect.colliderect(wall.rect)andwall.destructible:
can_move=Falsebreak#检查边界ifnew_x<0ornew_x+self.width > WIDTHornew_y<0ornew_y+self.height > HEIGHT:
can_move=False#如果可移动,则更新位置ifcan_move:
self.x =new_xself.y =new_y#更新方向ifdx>0:
self.direction =1elifdx<0:
self.direction =3elifdy>0:
self.direction =2elifdy<0:
self.direction =0defupdate(self,walls):
if notself.alive:
returnifself.cooldown >0:
self.cooldown -=1#敌人AIif notself.is_playerandself.alive:
#简单AI:随机移动和开火move_choice= random.randint(0,30)
ifmove_choice==0:
self.move(-self.speed,0,walls)
elifmove_choice==1:
self.move(self.speed,0,walls)
elifmove_choice==2:
self.move(0, -self.speed,walls)
elifmove_choice==3:
self.move(0,self.speed,walls)
#随机开火ifrandom.random() < ENEMY_FIRE_RATEandself.cooldown ==0:
returnself.fire()
return Nonedeffire(self):
ifself.cooldown >0:
return Noneself.cooldown = PLAYER_FIRE_RATEifself.is_playerelse30#根据坦克方向计算子弹起始位置ifself.direction ==0:#上bullet_x=self.x +self.width //2bullet_y=self.y
dx,dy=0, -1elifself.direction ==1:#右bullet_x=self.x +self.width
bullet_y=self.y +self.height //2dx,dy=1,0elifself.direction ==2:#下bullet_x=self.x +self.width //2bullet_y=self.y +self.height
dx,dy=0,1else:#左bullet_x=self.x
bullet_y=self.y +self.height //2dx,dy= -1,0returnBullet(bullet_x,bullet_y,dx,dy,self.is_player)
deftake_damage(self):
self.health -=1ifself.health <=0:
self.alive =Falsereturn Truereturn Falsedefdraw(self,surface):
if notself.alive:
return#绘制坦克主体tank_rect= pygame.Rect(self.x,self.y,self.width,self.height)
pygame.draw.rect(surface,self.color,tank_rect)
pygame.draw.rect(surface, WHITE,tank_rect,2)
#绘制坦克炮管ifself.direction ==0:#上pygame.draw.rect(surface, DARK_GREEN,
(self.x +self.width //2-5,self.y -15,10,20))
elifself.direction ==1:#右pygame.draw.rect(surface, DARK_GREEN,
(self.x +self.width,self.y +self.height //2-5,20,10))
elifself.direction ==2:#下pygame.draw.rect(surface, DARK_GREEN,
(self.x +self.width //2-5,self.y +self.height,10,20))
else:#左pygame.draw.rect(surface, DARK_GREEN,
(self.x -20,self.y +self.height //2-5,20,10))
#绘制生命值(仅对玩家)ifself.is_player:
foriinrange(self.health):
pygame.draw.rect(surface, RED,
(self.x +i*12,self.y -15,10,10))
classBullet:
def__init__(self,x,y,dx,dy,is_player):
self.x =xself.y =yself.dx =dxself.dy =dyself.radius =5self.speed = BULLET_SPEED
self.is_player =is_playerself.color = YELLOWifis_playerelseRED
self.alive =Truedefupdate(self):
self.x +=self.dx *self.speed
self.y +=self.dy *self.speed
#检查是否出界if(self.x <0orself.x > WIDTHorself.y <0orself.y > HEIGHT):
self.alive =Falsedefdraw(self,surface):
ifself.alive:
pygame.draw.circle(surface,self.color, (int(self.x),int(self.y)),self.radius)
pygame.draw.circle(surface, WHITE, (int(self.x),int(self.y)),self.radius,1)
defget_rect(self):
returnpygame.Rect(self.x -self.radius,self.y -self.radius,
self.radius *2,self.radius *2)
classWall:
def__init__(self,x,y,destructible=True):
self.x =xself.y =yself.destructible =destructibleself.color = BROWNifdestructibleelseGRAY
self.rect = pygame.Rect(x,y, WALL_SIZE, WALL_SIZE)
self.alive =Truedefdraw(self,surface):
ifself.alive:
pygame.draw.rect(surface,self.color,self.rect)
pygame.draw.rect(surface, WHITE,self.rect,1)
#添加纹理ifself.destructible:
pygame.draw.line(surface, (139,69,19),
(self.x +5,self.y +5),
(self.x + WALL_SIZE -5,self.y + WALL_SIZE -5),2)
pygame.draw.line(surface, (139,69,19),
(self.x + WALL_SIZE -5,self.y +5),
(self.x +5,self.y + WALL_SIZE -5),2)
else:
#不可破坏的墙壁有网格纹理foriinrange(0, WALL_SIZE,5):
pygame.draw.line(surface, (100,100,100),
(self.x,self.y +i),
(self.x + WALL_SIZE,self.y +i),1)
classGame:
def__init__(self):
self.player = Tank(WIDTH //2, HEIGHT -100, BLUE,True)
self.enemies = []
self.bullets = []
self.walls = []
self.score =0self.level =1self.ammo = MAX_AMMO
self.game_over =Falseself.game_won =Falseself.enemy_respawn_timer =0self.generate_walls()
self.spawn_enemies(3)
defgenerate_walls(self):
#创建边界墙forxinrange(0, WIDTH, WALL_SIZE):
self.walls.append(Wall(x,0,False))
self.walls.append(Wall(x, HEIGHT - WALL_SIZE,False))
foryinrange(WALL_SIZE, HEIGHT - WALL_SIZE, WALL_SIZE):
self.walls.append(Wall(0,y,False))
self.walls.append(Wall(WIDTH - WALL_SIZE,y,False))
#创建随机可破坏墙壁for_inrange(30):
x= random.randint(3, (WIDTH // WALL_SIZE) -4) * WALL_SIZE
y= random.randint(3, (HEIGHT // WALL_SIZE) -4) * WALL_SIZE
#确保不在玩家起始位置周围生成墙if(abs(x-self.player.x) >100orabs(y-self.player.y) >100):
self.walls.append(Wall(x,y,True))
#创建一些不可破坏的障碍物for_inrange(10):
x= random.randint(2, (WIDTH // WALL_SIZE) -3) * WALL_SIZE
y= random.randint(2, (HEIGHT // WALL_SIZE) -3) * WALL_SIZE
if(abs(x-self.player.x) >100orabs(y-self.player.y) >100):
self.walls.append(Wall(x,y,False))
defspawn_enemies(self,count):
for_inrange(count):
#在远离玩家的位置生成敌人while True:
x= random.randint(50, WIDTH -50)
y= random.randint(50, HEIGHT //2)
#确保敌人不与玩家太近if(abs(x-self.player.x) >200orabs(y-self.player.y) >200):
breakself.enemies.append(Tank(x,y, RED))
defhandle_events(self):
foreventinpygame.event.get():
ifevent.type == pygame.QUIT:
return Falseifevent.type == pygame.KEYDOWN:
ifevent.key == pygame.K_ESCAPE:
return Falseifself.game_overorself.game_won:
ifevent.key == pygame.K_r:
self.__init__()#重置游戏elifevent.key == pygame.K_SPACEandself.ammo >0:
bullet=self.player.fire()
ifbullet:
self.bullets.append(bullet)
self.ammo -=1if notself.game_overand notself.game_won:
keys= pygame.key.get_pressed()
dx,dy=0,0ifkeys[pygame.K_LEFT]orkeys[pygame.K_a]:
dx= -PLAYER_SPEED
ifkeys[pygame.K_RIGHT]orkeys[pygame.K_d]:
dx= PLAYER_SPEED
ifkeys[pygame.K_UP]orkeys[pygame.K_w]:
dy= -PLAYER_SPEED
ifkeys[pygame.K_DOWN]orkeys[pygame.K_s]:
dy= PLAYER_SPEED
#对角线移动速度修正ifdx!=0anddy!=0:
dx*=0.7071dy*=0.7071self.player.move(dx,dy,self.walls)
return Truedefupdate(self):
ifself.game_overorself.game_won:
return#更新玩家self.player.update(self.walls)
#更新敌人forenemyinself.enemies[:]:
bullet=enemy.update(self.walls)
ifbullet:
self.bullets.append(bullet)
#更新子弹forbulletinself.bullets[:]:
bullet.update()
#检查子弹是否击中墙壁forwallinself.walls[:]:
ifwall.aliveandbullet.get_rect().colliderect(wall.rect):
bullet.alive =Falseifwall.destructible:
wall.alive =Falseself.walls.remove(wall)
break#检查子弹是否击中玩家if notbullet.is_playerandbullet.alive:
player_rect= pygame.Rect(self.player.x,self.player.y,
self.player.width,self.player.height)
ifbullet.get_rect().colliderect(player_rect)andself.player.alive:
bullet.alive =Falseifself.player.take_damage():
self.game_over =True#检查子弹是否击中敌人ifbullet.is_playerandbullet.alive:
forenemyinself.enemies[:]:
enemy_rect= pygame.Rect(enemy.x,enemy.y,enemy.width,enemy.height)
ifbullet.get_rect().colliderect(enemy_rect)andenemy.alive:
bullet.alive =Falseifenemy.take_damage():
self.enemies.remove(enemy)
self.score +=100#移除已消失的子弹if notbullet.aliveandbulletinself.bullets:
self.bullets.remove(bullet)
#敌人重生逻辑iflen(self.enemies) < MAX_ENEMIES:
self.enemy_respawn_timer +=1ifself.enemy_respawn_timer >= ENEMY_RESPAWN_TIME:
self.spawn_enemies(1)
self.enemy_respawn_timer =0#检查关卡完成iflen(self.enemies) ==0andself.level <3:
self.level +=1self.spawn_enemies(self.level +2)
self.ammo = MAX_AMMO
self.player.health =min(3,self.player.health +1)
#检查游戏胜利ifself.level >=3andlen(self.enemies) ==0:
self.game_won =Truedefdraw(self,surface):
#绘制背景surface.fill(BLACK)
#绘制网格背景forxinrange(0, WIDTH, GRID_SIZE):
pygame.draw.line(surface, (20,20,20), (x,0), (x, HEIGHT))
foryinrange(0, HEIGHT, GRID_SIZE):
pygame.draw.line(surface, (20,20,20), (0,y), (WIDTH,y))
#绘制墙壁forwallinself.walls:
wall.draw(surface)
#绘制子弹forbulletinself.bullets:
bullet.draw(surface)
#绘制敌人forenemyinself.enemies:
enemy.draw(surface)
#绘制玩家self.player.draw(surface)
#绘制UIself.draw_ui(surface)
#绘制游戏结束/胜利画面ifself.game_over:
self.draw_game_over(surface)
elifself.game_won:
self.draw_game_won(surface)
defdraw_ui(self,surface):
#分数font= pygame.font.SysFont(None,36)
score_text=font.render(f"score:{self.score}",True, GREEN)
surface.blit(score_text, (10,10))
#等级level_text=font.render(f"level:{self.level}/3",True, GREEN)
surface.blit(level_text, (10,50))
#弹药ammo_text=font.render(f"bullet:{self.ammo}/{MAX_AMMO}",True, YELLOW)
surface.blit(ammo_text, (WIDTH -150,10))
#敌人数量enemies_text=font.render(f"enemy:{len(self.enemies)}",True, RED)
surface.blit(enemies_text, (WIDTH -150,50))
#控制说明controls_font= pygame.font.SysFont(None,24)
controls= [
"Controls: WASD/Arrow Keys to move, Space to fire",
"Objective: Eliminate all enemies (3 levels)",
"Note: Limited ammunition, can destroy brown walls"]
fori,textinenumerate(controls):
control_text=controls_font.render(text,True, WHITE)
surface.blit(control_text, (WIDTH //2-150,10+i*25))
defdraw_game_over(self,surface):
overlay= pygame.Surface((WIDTH, HEIGHT), pygame.SRCALPHA)
overlay.fill((0,0,0,200))
surface.blit(overlay, (0,0))
font_large= pygame.font.SysFont(None,72)
font_medium= pygame.font.SysFont(None,36)
game_over_text=font_large.render("game over",True, RED)
surface.blit(game_over_text, (WIDTH //2-game_over_text.get_width() //2, HEIGHT //2-100))
score_text=font_medium.render(f"finial score:{self.score}",True, WHITE)
surface.blit(score_text, (WIDTH //2-score_text.get_width() //2, HEIGHT //2))
restart_text=font_medium.render("Press R to restart",True, GREEN)
surface.blit(restart_text, (WIDTH //2-restart_text.get_width() //2, HEIGHT //2+100))
quit_text=font_medium.render("Press ESC to exit",True, YELLOW)
surface.blit(quit_text, (WIDTH //2-quit_text.get_width() //2, HEIGHT //2+150))
defdraw_game_won(self,surface):
overlay= pygame.Surface((WIDTH, HEIGHT), pygame.SRCALPHA)
overlay.fill((0,0,0,200))
surface.blit(overlay, (0,0))
font_large= pygame.font.SysFont(None,72)
font_medium= pygame.font.SysFont(None,36)
win_text=font_large.render("Victory!",True, GREEN)
surface.blit(win_text, (WIDTH //2-win_text.get_width() //2, HEIGHT //2-100))
score_text=font_medium.render(f"Final Score:{self.score}",True, WHITE)
surface.blit(score_text, (WIDTH //2-score_text.get_width() //2, HEIGHT //2))
restart_text=font_medium.render("Press R to restart",True, GREEN)
surface.blit(restart_text, (WIDTH //2-restart_text.get_width() //2, HEIGHT //2+100))
quit_text=font_medium.render("Press ESC to exit",True, YELLOW)
surface.blit(quit_text, (WIDTH //2-quit_text.get_width() //2, HEIGHT //2+150))
defmain():
clock= pygame.time.Clock()
game= Game()
running=Truewhilerunning:
running=game.handle_events()
game.update()
game.draw(screen)
pygame.display.flip()
clock.tick(FPS)
pygame.quit()
sys.exit()
if__name__ =="__main__":
main()

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-20 20:37:42 HTTP/2.0 GET : https://f.mffb.com.cn/a/484630.html
  2. 运行时间 : 0.116039s [ 吞吐率:8.62req/s ] 内存消耗:4,850.55kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=405949dd59c3e06c652b6b22e6325e19
  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.000590s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000812s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000292s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000365s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000506s ]
  6. SELECT * FROM `set` [ RunTime:0.000193s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000520s ]
  8. SELECT * FROM `article` WHERE `id` = 484630 LIMIT 1 [ RunTime:0.012848s ]
  9. UPDATE `article` SET `lasttime` = 1776688662 WHERE `id` = 484630 [ RunTime:0.000630s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000307s ]
  11. SELECT * FROM `article` WHERE `id` < 484630 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000440s ]
  12. SELECT * FROM `article` WHERE `id` > 484630 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000593s ]
  13. SELECT * FROM `article` WHERE `id` < 484630 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.007930s ]
  14. SELECT * FROM `article` WHERE `id` < 484630 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.007973s ]
  15. SELECT * FROM `article` WHERE `id` < 484630 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.015177s ]
0.117691s