You've been blasting enemies, defeating bosses, and climbing the leaderboard. But what if your friends could join the battle — from their own computers?
Today we're building multiplayer into the Vertical Shooter.
Same screen, same room — like Minecraft on a couch
Play together over the internet — THIS is what we're building!
Thousands of players in one world — like Fortnite or Roblox
Same device, different controllers — party games!
Remember Week 1? Browsers talk to servers!
In Week 1 we learned browsers send requests to servers. For multiplayer, we need computers to talk directly to each other — no middleman!
WebRTC lets browsers connect directly to each other — no app needed! Google, Microsoft, and Apple all built it into their browsers.
One player creates a room and gets a 4-letter code. Friends type the code to join — just like Among Us!
Up to 8 players can join one room!
One player (the host) runs the REAL game. Everyone else sends their button presses to the host, and the host tells everyone what's happening.
Star topology — everyone connects to one center point.
This prevents cheating! The host decides what's real.
If we don't add more enemies, 8 players would breeze through the game! So the game scales up with more players.
+50% per player
+25% per player
+40% per player
DUAL BOSS!
Multiplayer looks simple — until you realize how much state needs to sync!
Let's see multiplayer in action!
Now that we have multiplayer, the possibilities are endless. What feature would YOU add to make the game even better?
Think of a multiplayer feature that would be fun and possible. We might build it next week!