# This is our Round Manager. It controls the flow of a 1v1 match. # Think of this as the referee device. # --- EDITABLE PROPERTIES --- # These are the "slots" you fill in the editor. # They are Constants because they don't change during the game logic, # but you set them once in the device settings. RoundTime: float = 60.0 # How many seconds per round. Like a storm timer. MaxRounds: int = 10 # Total rounds in the match. # We need to connect our Verse script to the devices in the world. # This is like plugging a controller into the console. SpawnPad: PlayerSpawnerDevice = ? # Drag your Player Spawner here. ScoreMgr: ScoreManagerDevice = ? # Drag your Score Manager here. RoundTimer: TimerDevice = ? # Drag your Timer here. TeleportToHub: TeleporterDevice = ? # Drag your Teleporter here. # --- GAME STATE --- # These are Variables. They change as the game plays. CurrentRound: int = 0 GameActive: bool = false # --- FUNCTIONS --- # This function starts a new round. # It's like pressing the "Start Match" button. StartRound := func(): void = # Increment the round counter (1, 2, 3...) CurrentRound += 1 # Reset player positions SpawnPad.Reset() # Start the timer for this round RoundTimer.Start(RoundTime) # Log to chat so players know what's happening print("Round {CurrentRound} started!") # This function ends the round. # It handles the "Game Over" for this specific round. EndRound := func(): void = # Stop the timer RoundTimer.Stop() # Check if the game is still active if GameActive: # Determine the winner based on scores # (Simplified: we assume Score Manager handles the logic) # You could add logic here to check who has more points. # If we've played all rounds, end the game if CurrentRound >= MaxRounds: EndGame() else: # Wait a bit, then start the next round # For simplicity, we'll just call StartRound immediately # In a real build, you'd add a delay here. StartRound() # This function ends the entire match. EndGame := func(): void = GameActive = false print("Match Over! Teleporting to Hub.") # Teleport all players to the hub # We assume the Teleporter is set up to go to your hub map TeleportToHub.Activate() # --- EVENTS --- # This event fires when the device is placed in the level and the game starts. # It's like the "On Begin Play" in Unreal. OnBegin := func(): void = GameActive = true CurrentRound = 0 StartRound() # This event fires when the Timer finishes. # It's like the storm closing: time's up! OnTimerFinish := func(): void = EndRound() # This event fires when a player is eliminated. # We can hook this up to a Damage Volume or use the Score Manager events. # For this simple example, we'll assume the Timer dictates the round end. # In a more complex system, you'd check if a player reached 0 health. OnPlayerEliminated := func(player: Player): void = # You could add logic here, like "Instant Round Win" # For now, we let the timer decide. pass # Optional: Hook up Score Manager events if you want to track points # OnScoreChanged := func(player: Player, score: int): void = # pass