Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>InertNew to Visual Studio Code? Get it now.
Inert

Inert

yumoe

|
2 installs
| (0) | Free
在 VS Code 中运行 Inert 塔防游戏;基于 Corentin Thomasset 的开源项目二次开发。 / Play Inert tower defense in VS Code; a derivative work based on Corentin Thomasset's open-source project.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Inert 塔防 for VS Code

Inert Tower Defense for VS Code

VS Code 插件。直接在 VS Code 里游玩一款轻量塔防游戏。
VS Code extension. Play a compact tower defense game directly inside VS Code.

介绍

Introduction

Inert 塔防 for VS Code 是一个把网页塔防游戏封装进 VS Code Webview 的插件。
Inert Tower Defense for VS Code is an extension that packages a browser tower defense game into a VS Code Webview.

安装后,编辑器底部状态栏会出现 inert 入口,点击即可在 VS Code 内打开游戏。
After installation, an inert entry appears in the VS Code status bar. Click it to open the game inside the editor.

本插件基于开源项目 Inert 进行二次开发。
This extension is a derivative work based on the open-source project Inert.

  • 原项目作者:Corentin Thomasset
    Original author: Corentin Thomasset

  • 原项目仓库:https://github.com/CorentinTh/inert
    Original repository: https://github.com/CorentinTh/inert

  • 原网页版本:https://inert.thomasset.me
    Original browser version: https://inert.thomasset.me

当前插件版本在原游戏基础上加入了 VS Code 插件运行方式、中文默认界面、中/英文切换、敌人行进路线预测、暂停控制、插件图标、状态栏入口,以及若干性能和稳定性修复。
This extension adds VS Code packaging, default Chinese UI, Chinese/English switching, enemy path prediction, pause controls, an extension icon, a status bar entry, and several performance and stability fixes on top of the original game.

功能亮点

Features

  • VS Code 内运行:无需离开编辑器,点击底部状态栏 inert 即可打开游戏。
    Run inside VS Code: open the game by clicking the inert status bar entry.

  • 默认中文界面:游戏首次启动默认使用中文。
    Default Chinese UI: the first launch uses Chinese by default.

  • 中/英文切换:游戏右上角提供语言切换按钮。
    Chinese/English switch: switch languages from the top-right UI.

  • 敌人路径预测:右侧开关可显示或隐藏敌人预计行进路线;默认关闭,开启后以低干扰虚线显示。
    Enemy path prediction: show or hide predicted enemy routes from the right-side toggle; disabled by default and drawn as subtle dashed lines when enabled.

  • 暂停模式:暂停后敌人、弹药、防御塔攻击和刷怪计时停止;玩家仍可观察地图并放置防御塔。
    Pause mode: enemies, munitions, tower attacks, and wave timers stop while the player can still inspect the map and place towers.

  • 安全重新开始:浏览器调试环境继续使用页面刷新;VS Code / Trae 插件环境通过 Webview 消息重新注入游戏页面,避免宿主页面被刷新成日志内容。
    Safe restart: browser debugging still uses page reload; VS Code / Trae Webviews restart through extension messaging to avoid reloading the host page into log output.

  • 多种防御塔:包含加农炮、加特林、减速塔、狙击塔和激光塔。
    Multiple tower types: Canon, Gatling, Slower, Sniper, and Laser.

  • 性能优化:减少放塔预览时的高频寻路、弹药重复更新、静态网格重复绘制和重复 Webview 实例造成的卡顿。
    Performance fixes: reduced repeated pathfinding during tower preview, removed double munition updates, cached static grid rendering, and prevented duplicate retained Webview panels.

游戏玩法

How To Play

你的目标是保护地图中央的主基地。
Your goal is to protect the home base in the center of the map.

敌人会从一个或多个出生点沿着可通行路径向主基地移动。
Enemies spawn from one or more enemy bases and move toward the home base through valid paths.

如果敌人抵达主基地,基地会受到伤害;基地生命耗尽后游戏结束。
If enemies reach the home base, it takes damage; the game ends when the home base runs out of life.

你可以使用金币购买并放置防御塔。
You can spend cash to buy and place towers.

击败敌人会获得金币,金币可继续用于建设更多防御塔。
Defeating enemies grants more cash, which can be used to build more towers.

随着波次推进,敌人数量和强度会逐步增加。
As waves progress, enemies become stronger and more numerous.

基本流程

Core Loop

1. 打开游戏后观察敌人出生点和主基地位置。
1. Open the game and inspect the enemy bases and home base.

2. 在左侧选择一种防御塔。
2. Pick a tower from the left-side tower menu.

3. 将鼠标移动到地图格子上查看放置预览。
3. Move the cursor over the grid to preview tower placement.

4. 合法位置可以点击放置防御塔;非法位置会显示红色叉号。
4. Click to place a tower if the position is valid; invalid positions show a red cross.

5. 防御塔会自动索敌并攻击范围内敌人。
5. Towers automatically target and attack enemies in range.

6. 通过击败敌人获得金币,继续补充防线。
6. Earn cash from defeated enemies and keep strengthening your defense.

7. 必要时打开路径预测,查看敌人可能经过的路线。
7. Enable path prediction when you want to inspect likely enemy routes.

8. 需要思考布局时可以暂停,暂停期间仍可放塔。
8. Use pause when you need time to plan; tower placement remains available while paused.

防御塔说明

Tower Guide

防御塔 作用
加农炮
Canon
基础前期防御塔,价格低,适合开局补火力。
Low-cost early tower for basic damage.
加特林
Gatling
更高射速的持续输出塔,适合清理普通敌人。
Faster firing tower for steady damage output.
减速塔
Slower
让范围内敌人减速,适合配合高伤害塔使用。
Support tower that slows enemies in range.
狙击塔
Sniper
射程远、伤害高,但装填慢,适合打高生命敌人。
Long range and high damage, but slow reload.
激光塔
Laser
持续锁定单个敌人,聚焦越久伤害越高。
Focuses a beam on one enemy; damage grows while focused.

敌人和波次

Enemies And Waves

游戏包含普通敌人、装甲敌人、快速敌人、治疗敌人和 Boss。
The game includes simple enemies, armored enemies, fast enemies, healer enemies, and bosses.

后续波次会逐渐提高压力;部分敌人会更快、更肉,治疗敌人还会为附近敌人恢复生命。
Later waves increase pressure; some enemies become faster or tougher, and healer enemies restore nearby enemies.

插件使用方式

Extension Usage

从 VSIX 安装

Install From VSIX

1. 在 VS Code 中打开扩展面板。
1. Open the Extensions view in VS Code.

2. 点击扩展面板右上角 ...。
2. Click the ... menu in the Extensions view.

3. 选择 Install from VSIX...。
3. Choose Install from VSIX....

4. 选择本项目生成的 inert-1.1.1.vsix。
4. Select inert-1.1.1.vsix.

5. 安装完成后,编辑器底部会显示 inert。
5. After installation, the editor status bar shows inert.

6. 点击 inert 打开游戏。
6. Click inert to open the game.

也可以通过命令面板运行:
You can also run it from the Command Palette:

Inert: 打开塔防游戏

本地调试

Local Development

nvm use 14.21.3
npm ci
npm run dev

Parcel 默认会尝试使用 http://localhost:1234/index.html,如果端口被占用会自动换端口。
Parcel tries to use http://localhost:1234/index.html by default and automatically switches ports if that port is busy.

打包 VSIX

Package VSIX

nvm use 14.21.3
npm run package:vsix

打包产物:
Package output:

inert-1.1.1.vsix

上传插件市场前请确认

Pre-Marketplace Checklist

  • 确认 package.json 中的 publisher 已填写你的 Marketplace Publisher ID。
    Confirm that publisher in package.json is set to your Marketplace Publisher ID.

  • 确认 package.json 中的 description 已包含中文和英文介绍。
    Confirm that description in package.json includes both Chinese and English.

  • 确认插件图标 assets/icon.png 符合市场展示预期。
    Confirm that assets/icon.png works well as the Marketplace icon.

  • 确认 README、CHANGELOG、LICENSE 内容符合你的发布说明。
    Confirm that README, CHANGELOG, and LICENSE match your release requirements.

  • 使用新 VSIX 在本地 VS Code 和 Trae 中安装测试。
    Install the new VSIX locally in VS Code and Trae for testing.

  • 连续点击底部 inert,确认只会复用同一个游戏面板。
    Click the inert status bar entry repeatedly and confirm that it reuses a single game panel.

  • 测试暂停、路径预测、语言切换、放塔、游戏结束和重新开始等核心流程。
    Test pause, path prediction, language switching, tower placement, game over, and restart flows.

发布说明

Release Notes

当前版本面向 VS Code Marketplace 发布前验证。
This version is intended for pre-Marketplace validation.

它可以正常打包为 VSIX,也可以用于本地安装体验,但仍建议在上传市场前完成一轮真实 VS Code 和 Trae 环境测试。
It can be packaged as a VSIX and installed locally, but a real VS Code and Trae test pass is still recommended before Marketplace publishing.

已知后续可优化方向:
Known future improvements:

  • 后期敌人数量很大时,可以继续加入敌人空间索引,减少防御塔索敌开销。
    Add enemy spatial indexing to reduce tower targeting cost when late-game enemy counts become large.

  • 路径预测可以进一步缓存为 Path2D,降低开启预测后的绘制开销。
    Cache path prediction as Path2D to reduce drawing overhead when prediction is enabled.

  • 可以根据 Marketplace 需求补充截图、演示 GIF 和更正式的图标。
    Add screenshots, demo GIFs, and a more polished icon if needed for Marketplace presentation.

致谢

Credits

本插件是基于开源游戏 Inert 进行的 VS Code 插件化二次开发。
This extension is a VS Code extension derivative based on the open-source game Inert.

  • 原项目作者:Corentin Thomasset
    Original author: Corentin Thomasset

  • 原项目地址:https://github.com/CorentinTh/inert
    Original project: https://github.com/CorentinTh/inert

  • 原网页版本:https://inert.thomasset.me
    Original browser demo: https://inert.thomasset.me

二次发布或分发时,请保留原作者与原项目链接说明。
Please keep the original author attribution and project links when redistributing or publishing this extension.

许可证

License

本仓库包含 LICENSE 文件。
This repository includes a LICENSE file.

上传 Marketplace 前,请确认你的发布方式保留原项目署名,并符合仓库随附许可证的要求。
Before publishing to the Marketplace, verify that your distribution preserves the original project attribution and complies with the license shipped with this repository.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft