◀ VibeCruiser

space line

A free space shooter game — play it in your browser, no install. 星际防线 SpaceLine —— 单文件 HTML5 太空射击游戏:零依赖、全部图形由 Canvas 2D 实时绘制,同一份源码产出网页版 / 桌面便携版 / 安装包

by @kevin0521-wjw · kevin0521-wjw/space-line on GitHubLANG HTML★ 1HOSTED ON KEVIN0521-WJW.GITHUB.IOUPDATED 9 Oct 2026

Vote and save it — continue with GitHub or sign in free

Made this, @kevin0521-wjw? See how many people played it → or use email

▶ Play full screen ▲ Vote with GitHub ▲ Vote with email

GitHub asks to share your profile and email with us. We never post anything.

Open the live demo Source on GitHub

From the README

单文件 HTML5 太空射击游戏。 零第三方库、零图片、零音频资源——飞船、敌人、粒子、BOSS、星空全部由 Canvas 2D 实时绘制。整个游戏就是 index.html 一个文件,双击即玩。

同一份源码同时产出三种形态:网页版 / 桌面免安装版(portable exe) / 桌面安装包(NSIS)。

AI 不直接改飞船坐标,而是拿一个「虚拟手柄」:一个接口与 Input 完全同形的对象。Game.update() 里只有一处切换输入源:

于是走位插值、碰撞判定、机身倾斜、尾焰、冲刺无敌帧、激光结算全部复用玩家那一套代码,AI 没有第二套运动学。它因此也不可能作弊:移动速度上限被 CFG.PLAYER.SPEED / CFG.TOUCH.FOLLOW 这个「领先量」卡死,与键盘玩家完全相同。

它怎么决定往哪走:在 41×5 的候选网格上最大化一个标量目标——攻击收益 − 危险度 × SAFETY。

几个刻意的设计约束:AI 的纵向活动范围锁在画布高度的 52%~90%——上界保证它永远停在 BOSS 本体高度之下(所以代码里干脆不做 BOSS 本体碰撞判定),下界避免它贴到「漏怪线」上。

Read the full README on GitHub →

Built something like this? Submit your vibe — free account, takes a minute. How listing works.

More like this

Made this?

Claim it: create a free account, then press CLAIM THIS in the cruiser. Put the badge below in your README or on your demo page first; that link is how we know it's yours.

Your project is on the cruise, loaded live from your own site. Put the badge in your README or on the demo page: it shows your live play count, it links back to this page, and everyone who lands here is one click from running the real thing.

On VibeCruiser

How listing, the badge and claiming work →