Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
貪食蛇,一個完成度很高的小型 React 遊戲。
Translation pending
GamesTypeScript · BatchfileGitHub @rita112025-cpuOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗React + Vite + Tailwind CSS 製作的現代化貪吃蛇遊戲。
本地啟動後開 http://localhost:3000
npm install
npm run dev
Windows(portable Node,不需安裝):直接雙擊 start.bat
npm run typecheck
npm run build
Windows:雙擊 build.bat
GitHub Actions.github/workflows/deploy.yml,push 到 master/main 會自動 build 並部署https://<你的帳號>.github.io/<repo 名>/README 頂部保留 HF 所需的 frontmatter 時亦可直接推到 Static Space:
sdk: static
app_build_command: npm run build
app_file: dist/index.html
src/
App.tsx 畫面組裝
types.ts 共用型別
game/ 純遊戲邏輯(不依賴 React,可單獨測試)
engine.ts 每個 tick 的規則:移動、碰撞、吃食物、過關
levels.ts 關卡資料(ASCII 地圖 + 參數 + 配色 + 配樂)
compileLevel.ts 地圖解析與檢查(地圖寫錯會在載入時直接報錯)
config.ts 難度、食物、連擊等可調參數
grid.ts 座標工具
audio/
core.ts AudioContext、音量與開關設定
sfx.ts 音效
tracks.ts 每關配樂的音符資料
music.ts 配樂播放器
hooks/
useSnakeGame.ts 遊戲迴圈、狀態、存檔
useControls.ts 鍵盤與滑動
useAudio.ts 音訊設定、背景音樂
components/ GameBoard、Hud、GameOverlay、DPad、AudioControls
src/game/levels.ts 的 LEVEL_DEFINITIONS 加一筆,地圖圖例:. 空地、# 牆、S 起點(蛇頭朝右,身體往左兩格需為空地)、1–9 傳送門(同數字成對)、H 水平巡邏者、V 垂直巡邏者。src/types.ts 的 TrackId 加一個配樂代號,並在 src/audio/tracks.ts 寫對應的音符。npm run typecheck:漏寫配樂會在型別檢查時報錯,地圖錯誤會在載入時報錯。