학번과 성명을 입력하고 방향키로 뱀을 움직여 점수를 올리는 스네이크 게임
Translation pending
AI summary · website content
GamesJavaScript · CSSGitHub @kuekkuek85-85OnlineOwner 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 ↗중학교 정보 수업에서 학생들이 직접 플레이하는 PC·스마트폰 웹 기반 스네이크 게임입니다. 한 판이 끝나면 학번·성명·점수가 Firebase Firestore에 저장되고, 대시보드에서 우리 반 전체의 순위를 실시간으로 확인할 수 있습니다.
정보 수업용 스네이크 게임 PRD(v1.0) 기반 구현
10130)·성명 입력, 유효성 검사bestScore 내림차순 순위표, 내 행 하이라이트, 반별 필터, 1~3위 메달.
├─ index.html # 시작 / 게임 / 게임오버 화면
├─ dashboard.html # 실시간 순위 대시보드
├─ css/style.css
├─ js/
│ ├─ game.js # 게임 엔진(이동·충돌·렌더링, 순수 로직)
│ ├─ main.js # 화면 전환 / 입력 / 저장 오케스트레이션
│ ├─ db.js # Firestore 연동(players / scores)
│ ├─ dashboard.js # 대시보드 실시간 구독
│ ├─ sound.js # 효과음(WebAudio)
│ └─ firebase-config.js # Firebase 프로젝트 설정 (채워 넣어야 함)
├─ firestore.rules # 보안 규칙 예시
└─ firebase.json # Firebase Hosting + Firestore 설정
ES 모듈을 사용하므로 file://로 직접 열면 동작하지 않습니다. 간단한 정적 서버로 실행하세요.
# Python
python3 -m http.server 8080
# 또는 Node
npx serve .
브라우저에서 http://localhost:8080 접속.
Firebase를 설정하지 않아도 게임은 로컬로 동작합니다(기록 저장/대시보드만 비활성화).
js/firebase-config.js의 firebaseConfig 값을 교체firestore.rules를 배포:npm install -g firebase-tools
firebase login
firebase deploy --only firestore:rules
players/{학번} — 학생별 최고 기록 1건
| 필드 | 타입 | 설명 |
|---|---|---|
studentId | string | 학번, 숫자 5자리 (예: 10130) |
name | string | 성명 |
className | string | 반 (예: 1-1), 대시보드 필터용 |
bestScore | number | 개인 최고 점수 |
playCount | number | 플레이 횟수 |
updatedAt | timestamp | 최고 기록 갱신 시각 |
scores/{자동ID} — 모든 플레이 로그(보조)
최고 기록 갱신은 트랜잭션으로 처리하여, 현재 점수가 기존 bestScore보다 높을 때만
bestScore/updatedAt을 갱신하고 playCount는 매판 +1 합니다.
firebase deploy --only hosting
또는 Vercel 등 정적 호스팅에 그대로 올려도 됩니다.
PC (키보드)
| 키 | 동작 |
|---|---|
| 방향키 / WASD | 상하좌우 이동 |
| 스페이스바 | 일시정지 / 재개 |
스마트폰 (터치)
| 조작 | 동작 |
|---|---|
| 보드 위 스와이프 | 스와이프 방향으로 이동 |
| 화면 하단 방향 패드(▲◀▶▼) | 상하좌우 이동 |
| 가운데 ⏸ 버튼 | 일시정지 / 재개 |
방향 패드는 터치 기기 또는 좁은 화면(≤640px)에서 자동으로 나타납니다.