# This is our main "Round Manager" device. # Think of this device as the "Game Director." verse_device class RoundManager: # These are the "props" (variables) we need to talk to other devices. # We connect these in the UEFN editor later. StartButton: ButtonDevice = ButtonDevice{} BossSpawner: NpcSpawnerDevice = NpcSpawnerDevice{} # This is the main function. It runs when the device starts. # It contains our infinite Game Loop. RunGameLoop(): void = # The "Infinite Loop" is the Battle Bus that never lands. # It keeps running forever until we stop it. loop: # 1. WAIT FOR THE BUTTON # We "await" the button being pressed. # This is like waiting for the Storm to close. # The code pauses here until a player hits the button. await StartButton.Pressed # 2. START THE ROUND # The button was hit! Now we start the round. # We tell the spawner to spawn the Boss. BossSpawner.Spawn() # 3. WAIT FOR THE ROUND TO END # We need to wait for the Boss to die OR time to run out. # We use "any" to wait for the first of two things to happen. # - BossSpawner.Eliminated: The Boss died. # - TimerDevice.After(30s): 30 seconds passed. # Note: In a real scenario, you'd connect a TimerDevice here. # For this simple example, we'll just wait for the Boss to die. await BossSpawner.Eliminated # 4. RESET FOR NEXT ROUND # The round is over. Do some cleanup. # Maybe play a sound, show a UI message, etc. # Then, the loop goes back to the top and waits for the button again!