This Chrome Browser Extension simulates flying over an endless landscape, every time you pop a new browser tab.
You can visit here to see how it behaves without cloning this repo.
Because this extension uses
simplex-noise.js
as a submodule, make sure you git clone using the --recursive flag
to get the submodule.
You can also just try this out with python3 -m http.server 50001 and surf to localhost:50001/landscape5.html to see the effect without installing as an extension.
- Inspiration was the SnowSpeeder rescue scene in Empire Strikes Back. Ideally we would do a real snowy landscape with rocks, but this landscape has green parts and some snowy parts. Oh well.
- Camera follows a spline so it's smoother flying over the landscape, much like the land speeders.
- The terrain maps stretch to the horizon more or less, but the far edges are obscured by fog. As you fly forward in space, the code deletes the maps behind you when generating a new map in front of you, so it appears to be "endless" terrain but we don't have to generate too much terrain at any given moment.
- Between sections of terrain, we try to smooth your motion between two splines rather than trying to line them up perfectly. This gives a bit of a "bounce" feeling sometimes, which is a bit like the snowspeeders. See
moveCamerawith an acceleration and dampener for the Y position.
The generation step is too slow. This could be more incremental and fit within 10ms frame rates.
