Verse Library verse

01 Fragment

Orchestrates camera and HUD message playback using device finish events and sequential waiting.

verse-library/5-setting-up-the-devices/01-fragment.verse

# TitleSequence.verse
# This script controls a simple title sequence: Camera -> Message -> Done

# 1. DEFINE THE DEVICES (The "Loot Boxes")
# We declare variables to hold references to our devices.
# Think of this as labeling the boxes so we know what's inside.
my_camera := Fixed_Point_Camera_Device{}
my_message := Hud_Message_Device{}
my_trigger := Trigger_Device{}

# 2. DEFINE CONSTANTS (The "Blueprints")
# These values never change once set.
const welcome_message_duration := 3.0 # Seconds
const camera_duration := 5.0 # Seconds

# 3. THE MAIN LOGIC (The "Game Loop")
# This function runs when the game starts.
main := @() =>
{
    # Step A: Start the Camera
    # We call the 'Play' function on our camera variable.
    # This is like pressing the 'Play' button on a video player.
    my_camera.Play()

    # Step B: Wait for the camera to finish
    # We use 'Wait' to pause the script until the camera is done.
    # Think of this as waiting for the storm to close before you loot.
    wait(my_camera.Get_Finish_Event())

    # Step C: Show the Message

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in