Creating Win Conditions and Ending the Game
In this lesson you'll learn to
- Explain what a win condition is and why every game needs one
- Use an End Game Device to stop a Fortnite island when a player wins
- Subscribe to the EliminatedEvent to count player eliminations in Verse
- Check an elimination count against a winning number and trigger the End Game Device
🏆 What Is a Win Condition?
Every game has a moment when someone wins. In checkers, you win when you take all your opponent's pieces. In a race, you win when you cross the finish line first.
In Fortnite, your island needs the same thing — a rule that says "You did it! Game over!"
That rule is called a win condition. It's just an if-then idea:
If something happens enough times → then end the game and celebrate the winner!
🧩 The Pieces We Need
Think of building this like a LEGO set. We need three pieces:
| Piece | What It Does |
|---|---|
| EliminatedEvent | Tells our code every time a player is eliminated |
| A counter (variable) | Keeps score — it counts up each elimination |
| End Game Device | The magic button that actually ends the round |
📦 What Is a Variable?
A variable is like a scoreboard that changes during the game.
Imagine a whiteboard in gym class. You erase the old score and write a new one every time a team scores. That whiteboard is a variable — it changes!
In Verse, we write var in front of a variable name to say "hey, this number is allowed to change."
var EliminationCount : int = 0 # starts at zero, like a fresh scoreboard
int just means the value is a whole number (like 0, 1, 2, 3 — not 1.5).
🔔 What Is an Event Subscription?
Imagine you sign up for text alerts from a pizza place. Every time a new deal drops, you get a message automatically — you don't have to keep checking!
Subscribing to an event works the same way. We tell Verse:
"Hey, every time a player gets eliminated, automatically run my special function!"
That special function is called an event handler. It's the code that runs when the event happens.
We subscribe like this:
FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated)
This says: "When this character is eliminated, call my function named OnPlayerEliminated."
🛑 What Is the End Game Device?
The End Game Device is a real UEFN device you place on your island. When your Verse code tells it to Activate, it ends the round — just like a referee blowing the final whistle!
We call it like this:
EndGameDevice.Activate(Player)
Player is who triggered the win — so Fortnite knows who to celebrate! 🎉
🗺️ Putting It All Together
Here is the big picture in plain English:
- When the game starts, set the winning number (like "first to 3 eliminations wins").
- Subscribe to the EliminatedEvent for every player.
- Every time someone gets an elimination, add 1 to the scoreboard.
- Check if the scoreboard reached the winning number.
- If YES → Activate the End Game Device → 🎉 Winner!
That's it! Let's see it in real Verse code.
Keep going — free
You've read the intro. The rest of this lesson — the worked example, the hands-on exercise, the quiz, and the recap — is free for members. Sign in to continue and track your progress.
New here? The whole Verse Basics track is free with a free account — sign in to start.
© Biloxi Studios Inc. — original Verse Island content.
Turn this into a guided course
Add Creating Win Conditions and Ending the Game to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
🧭 The Keeper's log
Quest complete? Chart your next heading from the Build Your First Game expedition.