logo

Babylon.js Market

By Lawrence

5 minutes

Catching up?

Dropping in at this lesson? One command reinstalls the library components the build uses so far and writes the scene as it stood at the end of the previous lesson to public/scenes/SpaceshooterFlight-lesson-12/scene.json:

bjs download scene SpaceshooterFlight-lesson-12 --all

The scene you are caught up to at the start of this lesson, rendered from the full asset download.

Copy that scene.json over your src/scenes/spaceshooter.json and you are caught up to the start of this lesson.

You have been flying this whole course by eye. No crosshair, no idea which of the four contacts is locked, no health, no score, and no way to tell whether the fighter crossing your nose at 400 metres is about to be hit or missed by fifty.

        "SpaceShooterHUD": {}

The HUD draws as DOM elements over the canvas rather than in 3D — brackets, readouts and the reticle are absolutely-positioned divs, which is why the System guards its work behind typeof document and does nothing at all in a headless render.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search