Commit a224d343

a224d343e9beMergedon cedricvidal-66f663

cedricvidal · 2 months ago · 3 files · +1 added · ~2 modified

Details

Commit
a224d343e9be
Parent
866d43068504

README.mdaddedView file

1+# Rubik's Cube 3D
2+
3+A 3D Rubik's Cube game built with TypeScript, Vite, and Three.js.
4+
5+## Run
6+
7+```bash
8+npm install
9+npm run dev # dev server at http://localhost:5173
10+npm run build # type-check + production build to dist/
11+```
12+
13+## How to play
14+
15+- **Drag a sticker** to turn its layer (middle layers work too).
16+- **Drag the background** to orbit the camera; scroll to zoom.
17+- **Keyboard**: `U D L R F B` turn faces clockwise; hold `Shift` for
18+ counter-clockwise (standard cube notation).
19+- **Scramble** starts a timed game with a move counter; solve the cube to
20+ stop the clock.
21+- **Reset** returns the cube to the solved state.
22+
23+## Code layout
24+
25+| File | Role |
26+| --- | --- |
27+| `src/cube.ts` | Builds the 26 cubie meshes with sticker materials |
28+| `src/rubiks.ts` | Move queue, animated 90° layer turns, scramble, solved detection |
29+| `src/dragControls.ts` | Raycast-based drag-to-turn pointer input |
30+| `src/scene.ts` | Renderer, camera, lights, resize handling |
31+| `src/main.ts` | Game state (idle / scrambling / playing), HUD, keyboard input |