---
title: "How to build a real-time multiplayer game with Flutter Flame"
description: "A real-time multiplayer UFO shooting game can be built with Flutter, the Flame game engine and Supabase Realtime."
url: "https://swe.quest/articles/how-to-build-a-real-time-multiplayer-game-with-flutter-flame-cc7e275b27a553e7"
canonical: "https://supabase.com/blog/flutter-real-time-multiplayer-game"
source: "Supabase"
published: "2023-02-14"
difficulty: "medium"
kind: "How-to"
reading_minutes: 18
tags: ["gaming","realtime","mobile"]
---

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

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-02-14, 18 min read, How-to. Original: [https://supabase.com/blog/flutter-real-time-multiplayer-game](https://supabase.com/blog/flutter-real-time-multiplayer-game)

## Summary

A real-time multiplayer UFO shooting game can be built with Flutter, the Flame game engine and Supabase Realtime. Flame components handle the player and bullet sprites, collision detection with hitboxes, pan-gesture movement and health gauges. Player position is sent as a mirrored percentage of screen size so each client sees its opponent from the opposite side. Supabase presence powers a lobby that waits for two players, and broadcast messages over a low-latency WebSocket sync position, health and game start between clients.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Games](https://swe.quest/tags/gaming.md) (Domains)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)

## Prerequisites

- Flutter widgets
- Dart basics

## Keywords

Flutter, Flame, Supabase Realtime, Dart

## Related posts

- [Flutter Tutorial: building a Flutter chat app](https://swe.quest/articles/flutter-tutorial-building-a-flutter-chat-app-942d133b45bb7fa6.md): Supabase · 2022-06-30 · Medium · 19 min read · Mobile, Real-time systems, PostgreSQL, Communications
  A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase\_flutter SDK instead of a custom API.
- [Create a Figma Clone app with Flutter and Supabase Realtime](https://swe.quest/articles/create-a-figma-clone-app-with-flutter-and-supabase-realtime-bc5c75e7ac04059a.md): Supabase · 2024-01-26 · Medium · 20 min read · Real-time systems, Mobile, Frontend, PostgreSQL
  A collaborative design canvas, a simplified Figma, built by combining Supabase Realtime Broadcast for low-latency client-to-client messaging with Flutter's CustomPainter for low-level canvas rendering.
- [Make a Multiplayer Game with Kaboom.js and Heroic Labs](https://swe.quest/articles/make-a-multiplayer-game-with-kaboom-js-and-heroic-labs-c70665185deec0fa.md): Replit · 2022-02-15 · Medium · 19 min read · Games, Real-time systems, JavaScript
  A multiplayer platformer can run in Replit's browser IDE using the Kaboom.js game library on the client and Heroic Labs' open source Nakama server, run locally via Docker Compose with Postgres, as the backend.
- [Flutter Authorization with RLS](https://swe.quest/articles/flutter-authorization-with-rls-f1170d28eed05738.md): Supabase · 2022-11-22 · Medium · 25 min read · PostgreSQL, Identity & auth, Mobile, Real-time systems
  Extends a basic Flutter real-time chat app into a 1-on-1 chat with authorization enforced by PostgreSQL Row Level Security on Supabase.
- [Making a Real-Time Chat App with Supabase on Replit](https://swe.quest/articles/making-a-real-time-chat-app-with-supabase-on-replit-0a77c4de25e9cc9d.md): Replit · 2022-03-23 · Medium · 8 min read · Real-time systems, Frontend, JavaScript, PostgreSQL
  A real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
