Video & Cutscenes
Doodle Engine supports fullscreen video cutscenes triggered from dialogue. Videos play as an overlay and can be skipped by the player.
Adding a Video
Section titled “Adding a Video”Use the VIDEO keyword in a dialogue node:
NODE dramatic_reveal VIDEO intro_cinematic.mp4 NARRATOR: @narrator.after_videoThe video plays fullscreen before the dialogue text is shown.
How It Works
Section titled “How It Works”- The parser converts
VIDEO filenameinto aplayVideoeffect - The effect sets
pendingVideoon the game state - The snapshot includes
pendingVideoas a transient field that appears once and is automatically cleared - The renderer picks up
pendingVideoand shows theVideoPlayercomponent
Using with GameShell
Section titled “Using with GameShell”If you’re using GameShell, video playback is automatic. Configure the video file location:
<GameShell registry={registry} config={config} videoBasePath="/assets/video" />The default videoBasePath is '/video'.
Using with a Custom Renderer
Section titled “Using with a Custom Renderer”For custom renderers, use the VideoPlayer component directly:
import { VideoPlayer } from '@doodle-engine/react';
function MyGame() { const { snapshot } = useGame(); const [video, setVideo] = useState<string | null>(null);
useEffect(() => { if (snapshot.pendingVideo) { setVideo(snapshot.pendingVideo); } }, [snapshot.pendingVideo]);
return ( <> {video && ( <VideoPlayer src={video} basePath="/video" onComplete={() => setVideo(null)} /> )} {/* rest of your UI */} </> );}VideoPlayer Props
Section titled “VideoPlayer Props”| Prop | Type | Default | Description |
|---|---|---|---|
src | string | required | Video file name |
basePath | string | '/video' | Base path for video files |
onComplete | () => void | required | Called when video ends or is skipped |
className | string | '' | CSS class |
Skipping Videos
Section titled “Skipping Videos”Players can skip a video using:
- The Skip button displayed on the video overlay
- Escape, Space, or Enter keys
File Organization
Section titled “File Organization”Place video files in your assets directory:
assets/ video/ intro_cinematic.mp4 chapter2_cutscene.mp4 ending.mp4Examples
Section titled “Examples”Intro cutscene on first visit
Section titled “Intro cutscene on first visit”TRIGGER tavernREQUIRE notFlag seenIntro
NODE start VIDEO intro_cinematic.mp4 NARRATOR: @narrator.intro SET flag seenIntro
CHOICE @narrator.choice.continue END dialogue ENDVideo mid-conversation
Section titled “Video mid-conversation”NODE reveal BARTENDER: @bartender.dramatic_line VIDEO dramatic_reveal.mp4 GOTO after_reveal
NODE after_reveal BARTENDER: @bartender.after_reveal
CHOICE @bartender.choice.respond GOTO next ENDMultiple cutscenes in a quest
Section titled “Multiple cutscenes in a quest”NODE quest_complete VIDEO quest_complete_cinematic.mp4 MERCHANT: @merchant.quest_complete SET questStage odd_jobs complete ADD variable gold 50 NOTIFY @notification.quest_complete
CHOICE @merchant.choice.thanks GOTO farewell END