---
title: "How to build a real-time multiplayer game with Flutter Flame"
description: "The tutorial builds a real-time multiplayer shooting game with Flutter, the Flame game engine, and Supabase Realtime. Each player controls a UFO by dragging, while the game automatically fires bullets in three directions; opponents’ positions and health points are synchronized over Supabase’s low-latency web socket connection. The implementation starts with Flutter widgets for the game page and lobby, then defines Flame components for the game, players, bullets, collision detection, movement, and health changes, before wiring Supabase broadcast events to client updates. A lobby waits for at least another player, and starting a match creates a shared channel so both clients can begin together. The completed application supports gameplay and a post-game dialog, allowing players to return to the lobby without managing their own networking infrastructure."
---

# How to build a real-time multiplayer game with Flutter Flame

[Supabase](https://yomu.fyi/company/supabase) · tyler\_shukert · Feb 14, 2023

**Type:** Tutorial

## Summary

The tutorial builds a real-time multiplayer shooting game with Flutter, the Flame game engine, and Supabase Realtime. Each player controls a UFO by dragging, while the game automatically fires bullets in three directions; opponents’ positions and health points are synchronized over Supabase’s low-latency web socket connection. The implementation starts with Flutter widgets for the game page and lobby, then defines Flame components for the game, players, bullets, collision detection, movement, and health changes, before wiring Supabase broadcast events to client updates. A lobby waits for at least another player, and starting a match creates a shared channel so both clients can begin together. The completed application supports gameplay and a post-game dialog, allowing players to return to the lobby without managing their own networking infrastructure.

## Context

The work extends a Flutter application into an interactive multiplayer game, using Flame for game-development capabilities and Supabase Realtime to let players compete against each other in real time without managing their own infrastructure.

## Approach / What changed

The implementation combines Flutter widgets for the game page, lobby, and post-game dialog with a FlameGame containing Player and Bullet components. Player movement and health updates are sent through Supabase broadcast messages on a channel named for the game, while received messages update the opponent’s position and health.

## Takeaways

- Flame provides the game layer used for player and bullet components, pan-based movement, image sprites, and collision detection.
- Supabase broadcast messages synchronize each player’s position and health over a low-latency web socket connection.
- The lobby requires at least two waiting users before starting, and the post-game dialog lets players return to the lobby after a win or loss.

**Tags:** [Open Source](https://yomu.fyi/topic/open-source), [Performance](https://yomu.fyi/topic/performance)

- Source: [Supabase](https://supabase.com/blog/flutter-real-time-multiplayer-game)
- Source URL: https://supabase.com/blog/flutter-real-time-multiplayer-game
- Ingested by Yomu: 2026-08-29T01:16:26.883Z

[Read original post](https://supabase.com/blog/flutter-real-time-multiplayer-game)
