Walking Buddies is an asynchronous multiplayer system that synchronizes the mouse position across three different devices.
Each participant has a small on-screen widget — a “buddy” — that moves according to its owner’s cursor.
All movements are stored and transmitted in real time through a Supabase database


character.js continuously reads local mouse coordinates using window.electronAPI.getMousePosition() every 50 ms.
If the position changes, it sends the update to Supabase and animates the local buddy.
db.js manages the Supabase connection:
Each user has a record containing position and heartbeat
On update, Supabase broadcasts changes to all clients:
channel.on("postgres_changes", { event: "UPDATE" }, payload => {
updateRemotePosition(characterId, data.data.position);
});Buddies interpolate between currentPosition and targetPosition, adjusting direction and speed dynamically.
When idle, they perform small random movements to stay “alive.”
Each frame switches between idle and walk sprites for continuous animation.
A periodic heartbeat (Date.now()) confirms each client’s activity.
If no updates arrive for 30 s, the buddy fades out (leave animation).
Reconnection brings it back on screen.