2D Java Game Arcade

Eight small games, twenty-four modes, one browser port of the 2D Java Game Framework.

P2P Room Code ยท Online

Multiplayer Arena

Play head to head with a friend on two different devices across the internet. One player generates a 6-character room code, the other joins, and game traffic flows directly peer to peer with live in-game peer chat.

Under the hood

Every game here is a subclass of the same Game loop: a JavaScript port of a 2D game framework originally written in Java. Java no longer runs in browsers, so the framework's core (vector and rectangle math, input polling, easing equations) was ported to ES modules once, and each game is written against that same port.

Shared modules
ModuleUsed for
framework/game.js The update / draw game loop every game in the arcade runs on.
framework/vector2.js Positions, velocities and steering for every entity in every game.
framework/input.js Keyboard and mouse polling shared across all games.
game/particles.js, game/audio.js The particle bursts and synthesised sound effects each game reuses. The pool is held in typed arrays and drawn in batches, so a thousand live particles cost a few dozen draw calls between them.
net/session.js, net/protocol.js WebRTC data channel peer-to-peer multiplayer networking with dual channels (ordered reliable for events, unordered unreliable for real-time snapshots), room code generation, and ICE STUN/TURN fallback configuration.
net/chat.js In-game real-time chat overlay supporting quick emoji chips, floating auto-fade message bubbles, and full custom keyboard messaging during matches.
framework/quality.js Watches the frame time and scales glow, particle counts and the device pixel ratio to match. The quality button on every game pins it by hand.
framework/spatialgrid.js Uniform grid broad phase, so bullet against enemy stays cheap once a late wave fills the arena.
games/shell.js The chrome around each canvas: overlays, score readouts, mode pills and the sound, quality and fullscreen buttons.