Project Plateau
Project Plateau: four glass plates, one living valley, and the road back to camp.
翻訳待ち
No updates detected yet. GitHub releases will appear here.
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:漏寫配樂會在型別檢查時報錯,地圖錯誤會在載入時報錯。