Networked Multiplayer — C++ / Dragonfly

Fruit Ninjas

C++ Dragonfly Engine Socket Programming Networking Multiplayer

Overview

Fruit Ninjas is a networked multiplayer reimagining of the classic mobile game, built in C++ on top of the Dragonfly game engine. Between 2 and 5 players compete simultaneously to achieve the highest score by slicing fruit, while cooperating to avoid hitting bombs — which end the session for everyone.

The project focused specifically on low-level networking: rather than using a high-level networking library, everything was implemented through raw C++ socket programming. Custom message protocols were designed from the ground up to synchronize game state across all clients in a server-authoritative model.

Noteworthy Systems

Low-Level C++ Socket Programming

All networking was implemented directly through C++ socketsno networking middleware or library abstractions. This required manually managing socket lifecycle, connection state, send/receive buffers, and error handling for both the server and each client.

Custom Network Protocol Design

Designed and implemented custom message protocols for client-server communication. Messages covered: player input events, fruit spawn synchronization, score updates, bomb events, and session end conditions — all structured to minimize bandwidth while keeping game state consistent across all clients.

Server-Authoritative Architecture

The server owned and managed all authoritative game state — fruit positions, scores, and bomb events. Clients sent input events to the server, which resolved them and broadcast state updates back to all connected players, preventing any single client from having an unfair advantage or corrupting shared state.

Previous Project ← Tectonic Tactics