jevs-fly
A Three.js first-person flight, steered by Jev.
Web Dev Cody’s demo puts Jev in charge of flying through a Three.js scene. Each decision is the next steering input.
# Jev's Fly A colorful Three.js FPV garden game. A glowing fly swoops toward wandering goblins, and contact makes both characters pop into sparkles. The fly returns to its starting flower for the next round. [TypeSafe's Jev](https://docs.typesafe.ai/introduction) chooses its heading and dive about five times per second. ```bash npm install # Add TYPESAFE_API_KEY=apikey_... to .env for Jev decisions. npm start ``` Open <http://localhost:5173>. Click **LET'S FLY** to start and enable sound. `P` pauses the game and API calls, `M` mutes, and `H` hides the HUD. The **3RD PERSON | FPV** button above the fly view, or `V`, switches the main view between the chase camera and the fly's full-screen FPV camera. The other view moves into the small window. `?autostart=1` starts immediately. ## FPV flight The fly keeps the FPV style pitch, roll, yaw and throttle controller. Jev receives the goblin's bearing, its angle below the horizon and whether a tree or the ground blocks the line of sight to it. Trees are thin trunks under canopies that hang well above the ground, so for the path ahead it gets two things: the climb angle that keeps the fly skimming about 2 m over the ground and under the canopies, and the trunks the flight line would pass within 1.5 m of, with their distance, side and gap. Jev answers four typed questions: which way to turn, whether to sidestep a trunk, whether to climb or descend, and whether to dive at 30°, 45°, 60°, 75° or 90° along a clear line. The fly hunts low under the canopies and slips between trunks, so it can reach goblins standing under trees. The controller only stabilizes the fly, flies Jev's climb angle and sidesteps, and hovers if answers stop. The small camera view shows what the fly sees. Without an API key, the fly waits at its flower.