Endings & extras
What the player unlocks for good: the endings list and completion, the gallery, scene replay, movies and the music room.
Endings list and completion
Extras has an Endings tab (reached ones with their description, the others with their hint; secret ones only once reached) and shows “Found 42%” at the top.
// src/content/scenes.ts
completion: { show: true, count: ['endings', 'gallery', 'movies', 'music', 'achievements'] },
game.extras.completion() // { percent, found, total, parts: { endings: { found, total }, … } }
Extras: gallery, scene replay, movies, music room
// src/content/gallery/hill/index.ts
import image from './image.png'
export default defineGallery({ title: 'The hill', image /*, thumbnail */ }) // thumbnail: made for you
cg('hill') … cg(null) // in an event: show it, and unlock it in the gallery
cg('pond_memory', 'full_moon') // a variant of a layered CG (art → layered CGs)
// Replayable: listed in Extras → Scenes once the player has finished it (also when run inside another event with event())
export default defineEvent({ title: 'The pond', replay: 'The pond', run: async (ctx) => { … } })
// With a picture on its card (next to the event's index.ts):
import preview from './preview.png'
export default defineEvent({ title: 'The pond', replay: { title: 'The pond', preview }, run: … })
- Voices: the lines the player starred in the log (Favourite voices).
- Movies: every movie in
src/content/movies/(see Video) is a tile; it unlocks whenmovie('id')plays it (alsogame.extras.unlockMovie(id)). The tile shows itsposter, or the first frame of the video. Picking one closes Extras, plays the movie like in a scene (music fades out, black screen, skippable), then opens Extras again on the Movies tab. It runs through the eventsrc/content/events/extras/movie(change it to add a fade or a title card; keep its name), as a scene replay: the game is put back afterwards, and a movie shown through "Show all" stays locked.game.minigames.open('extras', { tab: 'movies' })opens Extras on a tab. - Music room: the Music tab lists the tracks from
src/content/scenes.ts(musicRoom); a track appears once it has started playing in the game. See Audio. Above the list sits the player (src/content/ui/MusicPlayer.tsx): what plays, a seek bar with the time, previous / play-pause / stop / next, repeat (off, all, this track) and shuffle. Picking a track plays it, picking it again pauses. Repeat this track uses the track's loop points (src/content/music.ts); all goes on to the next unlocked track and wraps; off stops at the end. Previous goes back to the start after 3 s, else to the track before. Keys / pad: arrows or d-pad reach every button and the bar (left / right seek), Y or H plays / pauses anywhere on the tab. The game's music comes back when the tab closes. From code:game.extras.playMusic(id)(ornull), ormusicPlayer/useMusicPlayer()/useMusicPosition()from@/core/audio/musicPlayer. - Extras is a full-screen minigame (
src/content/minigames/extras), opened withgame.minigames.open('extras')(a UI minigame: never part of a mid-scene save).{ tab: 'voices' }opens it on that tab; every other tab is still there to switch to (a tab the game does not have opens the first one). The title menu has Favourite voices once a line is starred, and the scene toolbar's Voices button opens it the same way. While it is open a running scene waits under it (no auto-play, no skipping); cancel (Esc / B), menu (Start) or ✕ closes it, and the pause menu never opens over it. - Its tabs: Gallery, Scenes, Movies, Music, Voices (when favourite voices are on), Endings (when the game has endings) and Achievements (not in visual novel mode) tabs (they scroll sideways on a phone). The title menu shows "Extras" once anything is unlocked. Gallery pictures open full screen and zoomable (see Image viewer).
- Thumbnails for the gallery grid are made automatically from every PNG/JPG/WebP/AVIF and layered CG inside
src/content/gallery/(size insrc/content/config/media.ts). Setthumbnailto use your own, or for pictures kept elsewhere. - Variants: each one unlocks when shown. The tile shows how many are unlocked (2/4); the viewer has a dot per variant (empty = not seen yet). Switch with left/right (when not zoomed in; zoomed in they pan), the shoulder buttons / tab keys (any zoom, to compare the same spot), a swipe, or by tapping a dot.
- Scene cards show the event's
preview, or without one the first CG or background it shows. Name the filepreview.png(or .jpg/.webp/.avif) and the build makes a small thumbnail of it. Locked scenes are a "?" card with no picture (no spoilers). - Show all (spoilers): a button on every tab that still has something locked (Gallery, Scenes, Movies, Music, Endings). After a warning it shows everything until Extras is closed. Locked scenes can then be played. Nothing is saved: watching a locked scene earns nothing (no scene, picture, read line, achievement or title screen; the across-saves data is put back afterwards).
- A replay plays over the title screen on black. Saving is off, and the game state (flags, items, relationships…) is put back afterwards.
- Keep replayable events to the scene itself:
maps.go, NPC walks and other map changes are not undone. - Changing it (
src/content/minigames/extras/index.tsx): every tab is built from the same parts:TabFrame("Nothing here yet." and Show all),Tile(a card of the grid tabs: picture or "?", title or "???") andNumberedRow(the "01" rows of Music and Endings). Restyle one of those and every tab follows; a new tab reuses them. game.extras:images(revealAll?),scenes(),unlockImage(id, variant?),imageUnlocked(id, variant?),unlockScene(id),replay(id),anyUnlocked().