Vector Arena

A wave survival shooter running on a browser port of the 2D Java Game Framework.

How to play

Desktop

  • WASD or arrows — move
  • Mouse — aim
  • Left click or Space — fire
  • Shift — dash (brief invulnerability)
  • P or Esc — pause · M — mute

Touch

  • Left half of the screen — floating move stick
  • Right half — aim stick, fires while held
  • Double tap the left half — dash
  • Landscape orientation gives you the most arena

Scoring

  • Kills within 2.6s of each other build a combo
  • Every 4 combo raises the multiplier, up to x10
  • Taking a hit resets the multiplier to x1
  • Drops: rapid, triple, scatter, shield, extra life

Under the hood

This repository is a 2D game framework written in Java — a game loop, vector and rectangle math, input polling, and Robert Penner's easing equations. Java no longer runs in browsers, so the framework's core was ported to ES modules and the game is written against that port. The classes keep their original names and signatures.

Java class to browser module
JavaBrowserNotes
game.framework.Game framework/game.js Same initialize / loadContent / update / draw hooks; requestAnimationFrame replaces the BufferStrategy loop.
game.framework.GameTime framework/gametime.js tick, start, stop and getDeltaTimeSeconds, fed by the frame timestamp.
game.framework.Vector2 framework/vector2.js Immutable operations, plus in-place variants for the hot path.
game.framework.MathHelper framework/mathhelper.js clamp, lerp, smoothStep, random, with frame rate independent damping added.
game.input.Keyboard / Mouse framework/input.js keyDown and keyDownOnce polling against DOM events.
game.animation.ease.* framework/ease.js All eleven easing families with the original (time, begin, change, duration) signature.
no Java counterpart framework/quality.js Watches the frame time and scales glow, particle counts and the device pixel ratio to match — a problem a desktop JVM window never had.
no Java counterpart framework/spatialgrid.js Uniform grid broad phase, so bullet against enemy stays cheap once a late wave fills the arena.

Easing curves, straight from the port

The wave banner, combo pop and enemy sway are all driven by these. Each canvas plots the ported function over a single second.