How I Built Three Small Party Games for a Spring Dinner
说明与用途
为一次晚宴构建了三款轻量级 Node.js 互动游戏:记忆游戏、石头剪刀布和抽奖机,已公开发布,易于本地部署,无需数据库,适合任何活动。
问题
Create simple, event‑friendly games that can run on a laptop and projector without complex infrastructure.
结果
Three fully functional, event‑ready games that can be deployed on a laptop and projector with minimal setup.
工作流
- 1. Design game concepts (memory, rock‑paper‑scissors, lottery).
- 2. Implement each as a small Node.js app with Express and plain JS.
- 3. For multiplayer game, use Socket.IO to share authoritative state.
- 4. For rock‑paper‑scissors, pre‑select winner before animation to avoid visual mismatch.
- 5. For lottery, use array removal to guarantee no repeats.
- 6. Add simple UI controls (Space to start, duration, quality).
- 7. Publish each repo with README and start scripts.
- 8. Run locally: npm install, npm start, open host and player URLs on devices.
- 9. Test on projector and phones, adjust settings via localStorage.
证据
All three are intentionally small Node.js applications. They serve static files with Express, keep the browser UI in plain HTML/CSS/JavaScript, and avoid a database.
The multiplayer game treats the server as the referee… the server compares it with the server‑owned sequence.
The lottery display has a slightly different invariant: a number that has already been drawn must not be available again.
- 记录日期: 2026-09-22T12:00:25.217Z