Skip to content
quest'n'click

CreateHow-toFor authorsApplies from 4.2.5

Title and credits

Cette page en françaisThis page on the GitHub wiki

What you get

A title screen with your background (or a silent looping video), your logo, a line of text at the bottom and its music, then New game and Continue; and the end credits, which scroll over the title's video when the player opens them.

Context and versions

game.ts in the engine repository (games/<id>/game.ts) or in a created project (game/game.ts). The fields below are those of 4.4.0; true from 4.2.5 (the quest-n-click command name used below).

Prerequisites

  • The background image as an image id the game ships (see Images), the logo as another one.
  • For a video: ffmpeg, which npm run assets uses to encode it (doctor).
  • For the music: a track in audio.music (Music in stems).

Where to run the commands

Edit game.ts; run npm run assets at the root of the engine repository, or of the created project.

Steps

  1. The title screen. In game.ts:

    titleScreen: { decor: 'decor/dining', logo: 'logo', music: 'theme', video: 'intro.mp4', footer: 'A tiny point-and-click. Turn your phone sideways.' },

    decor is required; logo, music, video and footer are optional.

  1. A video, if you want one. Put the file in the game's decor folder, art/decor/<name>.mp4 (games/<id>/art/decor/ in the engine repository, game/art/decor/ in a created project), and name it in video: '<name>.mp4'. Then encode it:

    # in the engine repository, or in the created project
    npm run assets

    Every .mp4 of that folder becomes public/assets/video/<name>.mp4: H.264, 720 pixels high, without sound, ready to stream. games/<id>/sources.json can move the source ("video": "private/asset/decor_{name}.mp4").

  1. The credits. The text, line by line; an empty string is a blank line:

    credits: ['THE NIGHT MARKET', '', "The reference chapter of quest'n'click (3.4)", '', 'Thanks for playing!'],
    creditsScreen: { video: 'outro.mp4', decor: 'decor/street' },

    creditsScreen is optional: without it, the credits play over the title's video, with the title's background as its poster.

  1. Check. npm run validate (engine repository) or npx quest-n-click validate (created project) refuses a text switch or {hero} in the footer or the credits; npm run dev shows the title.

Reference

FieldFormWhat it does
titleScreen.decorimage idthe background, drawn to cover the screen; the video's poster
titleScreen.logoimage idthe logo, dropped in from the top; its alternative text is the game's title
titleScreen.musicid of audio.musicthe music, started at the player's first tap on the title screen
titleScreen.videofile name in public/assets/video/a silent, looping video behind the logo
titleScreen.footertexta line at the bottom of the screen; translated (titleScreen/footer)
creditsScreen.videofile namethe credits' background video, dimmed; default the title's video
creditsScreen.decorimage idthe poster of that video; default the title's decor
creditstext linesthe credits, one entry per line, '' for a blank; translated (credits[0], credits[1]…)

What the player sees:

  • The title shows New game and Continue (Continue greyed out without a save), then Remix when the game has a world other than the story (Remix). The labels are ui.newGame and ui.continue.
  • The credits open from the pause menu (★, ui.credits) and from the sealed ending's card. They scroll over about 22 seconds; a tap closes them.

Expected result, and how to check it

npm run dev, in the engine repository or in the created project, opens the title with the background, the logo, the footer; the music starts at the first tap; Credits in the pause menu scrolls your lines.

Common errors

SymptomCauseFix
No background behind the logoThe decor image is not shippednpm run assets; check the id
The video never showsNot encoded (ffmpeg missing) or a different file namenpm run assets; video is the file name with .mp4
No music on the titleNo tap yet, or the music offTap the title; check the Music setting
"{hero}" in a text shown as written… (validate)A switch or {hero} in credits or footerWrite the text plainly

Files or data changed

game.ts (titleScreen, creditsScreen, credits), art/decor/*.mp4, and public/assets/video/ after npm run assets. The translations of titleScreen/footer and credits[n] go into the locale files (Translations).

Recovery or going back

Remove the field from game.ts: every one but titleScreen.decor is optional.

References