Verse Library verse

03 Device

Arms a minigame that launches jumping players, tracks bounce scores, and safely respawns fallen agents.

verse-library/verse-char-arena-capstone/03-device.verse

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

# CAPSTONE: THE BOUNCE ARENA — find + move + react, wired into one minigame.
#
# This pulls the whole Characters series together. A Button arms the arena;
# from then on every player who JUMPS gets launched skyward (MOVE) and scores
# a point (REACT), and any player who falls below a kill-floor is found and
# teleported back to safety (FIND + a device-native respawn). No trigger
# volumes, no hand-wired pads — the character API does it all from Verse.
#
# Series skills, combined:
#   * FIND   — GetPlayspace().GetPlayers() -> P.GetFortCharacter[]  (Lesson 1)
#   * MOVE   — SetLinearVelocity with a Forward/Left/Up vector3      (Lesson 2)
#   * REACT  — Body.JumpedEvent().Subscribe(...)                     (Lesson 3)
bounce_arena_device := class(creative_device):

    # Press to arm the arena.
    @editable
    ArmButton : button_device = button_device{}

    # Scoreboard bumped on every bounce.
    @editable
    BounceScore : score_manager_device = score_manager_device{}

    # A Teleporter placed at the safe respawn spot. We hand fallen players to
    # its Teleport(agent) — cleaner than computing a teleport position by hand.

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