Verse Library verse

01 Device

Manages timer cycles and perception triggers to track seeker vision and player spotting.

verse-library/hide-and-seek/01-device.verse

# This is our main game script.
# It is like the brain of the Seeker.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We create a "class". This is like a box for our code.
# It must be placed in the editor as a Verse device.
hide_and_seek_game := class(creative_device):

    # This is the "Perception Trigger" device.
    # Drag it from the editor into this property slot.
    @editable
    PerceptionTrigger : perception_trigger_device = perception_trigger_device{}

    # This is the "Timer" device.
    # It controls when the eyes open and close.
    @editable
    TimerDevice : timer_device = timer_device{}

    # This is the "Damage Volume".
    # It is the invisible box that catches players.
    @editable
    DamageVolume : damage_volume_device = damage_volume_device{}

    # We track whether the seeker's eyes are open.
    # false means the eyes start closed.
    var EyesOpen : logic = false

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