You are browsing as a guest. Sign up (or log in) to start making projects!

9h 0m 33s logged

Devlog #3

This one is three small things instead of one big thing. Controls, a code viewer, and a demo mode.

The flight controls were bad, so I fixed them

The first version had WASD and a speed of 12. That was it. Flying across the galaxy felt like wading through water, vertical movement was on Space/Shift which is apparently not what anyone expects, and the camera started and stopped instantly, which felt robotic.

New setup: base speed is 30, Shift is sprint (3.5x), E goes up and Q goes down, and scrolling the wheel multiplies your speed up or down so you can be precise inside a solar system and fast between constellations. Movement also has acceleration and deceleration now via lerping the velocity vector. This alone made it feel like an actual spaceship instead of a camera on rails.

Clicking a file moon opens the code

The moons in a solar system were just decoration, so now clicking one fetches the file through the server and opens a side panel with syntax highlighting via highlight.js. The trick on the server side is sending Accept: application/vnd.github.raw to the contents API, which hands back the raw file instead of a base64 blob wrapped in JSON. Saved me a decode step and a headache.

One small thing I got wrong first: I put a key on the <Canvas> to reset the camera when switching views, then forgot that clicking things while pointer lock is active is its own mess. Tooltips and clicks work fine through drei’s event system, but I did waste ten minutes confused about why my onClick wasn’t firing before realizing I had the handler on the wrong component.

Demo mode

There was no way to look at anyone’s galaxy except mine, which defeats the entire point of sharing a link. Now there’s a username box in the corner; type any GitHub account and it builds their galaxy from public repos. The server just hits /users/:user/repos anonymously, since public data doesn’t need the app token. Anonymous calls are rate limited to 60/hour, so this will need caching or token routing later, but it works for now.

Next up

Private repos and the public share link, probably. That means real sessions instead of my hardcoded username, which I’ve been putting off because I know it will be annoying.

0
43

Comments 0

No comments yet. Be the first!