Verse Library verse

01 Fragment

Initializes tile teams to neutral and manages team ownership logic upon player interaction.

verse-library/using-color-changing-tiles-devices-in-fortnite-creative/01-fragment.verse

using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Players }

# This is our main script class. Think of it as the "Brain" for our tiles.
# We inherit from creative_device, which means we can control devices.
class TileWarScript is creative_device()

    # VARIABLES (The State)
    # These are the "scores" of our game.
    # We create a list to hold our three tiles.
    # In Verse, a list is like a squad roster.
    var tiles := [
        Tile1, # Reference the device named 'Tile1' in the editor
        Tile2, # Reference 'Tile2'
        Tile3  # Reference 'Tile3'
    ]

    # This variable tracks who owns the tile.
    # Team: Neutral means no one owns it yet.
    # Team: Red or Blue means a team has claimed it.
    var current_owner := Team.Neutral

    # EVENT: OnBegin
    # This runs ONCE when the match starts.
    # Like the bus flying over the island—only happens at the start.
    event OnBegin()
        # Let's make sure all tiles start neutral (gray/white)
        # We loop through our list of tiles.
        for tile in tiles

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