Games
Cave Escape
A first-person cave escape built as a computer-graphics learning project (low emphasis on replay value, high emphasis on the rendering pipeline). Stack: vanilla ES modules, WebGL through a course tiny-graphics framework, multi-page HTML shell, and Vercel static hosting. Highlights: • Framebuffer mouse picking — render interactables in an off-screen pass with a dedicated shader so each object gets a unique ID (primarily via the blue channel); readPixels at the screen center maps the sampled color to the picked object—a classic GPU-friendly alternative to ray–triangle intersection. • First-person camera — map 2D mouse deltas to 3D camera rotation, combine with WASD translation, view/projection matrices, and pointer-lock–style first-person navigation. • Lighting tied to puzzles — Phong-style materials and multiple lights; toggling the torch changes scene brightness so a fluorescent password texture only appears in the dark, connecting the lighting model directly to gameplay. • Fire: particles → GPU texture — simulate flame on a 2D canvas (positions, lifetime, yellow-to-red color falloff), upload to WebGL as a dynamic texture on a quad in the cave—a practical “2D sim → texture → 3D” pipeline rather than physically accurate volumetrics.
Snake
25×25 Snake. • Easy — open board. • Medium — random barriers (connected map). • Hard — rival snake; absorb its length, respawns at yours. Score and speed scale with snake length. Solarized look.


