raw Software

HTML 5 Starship Shooter

Robert Eisele

Starship Shooter is a radial canvas timing game. Aim an orbiting ship and fire through two independently rotating barrier gaps to hit the core, extend the timer, and increase the difficulty. Pointer, touch, held controls, and keyboard input replace the original indirect Caps Lock and Control scheme.

Read the story

Starship Shooter is a radial timing game. A ship orbits two independently rotating barrier rings and fires toward the center. Each ring has one opening; a projectile reaches the core only when its fixed firing angle passes through both openings. Every hit adds time, while repeated hits make the barriers faster and their gaps narrower.

Testing a Circular Gap

Let \(\theta\) be a projectile's angle, \(\gamma\) the center angle of a ring opening, and \(\delta\) its half-width. Direct subtraction fails around the \(0\) and \(2\pi\) boundary, so the wrapped angular distance is

\[ d(\theta,\gamma)=\min\left(|\bar\theta-\bar\gamma|, 2\pi-|\bar\theta-\bar\gamma|\right), \]

where each barred angle is normalized to \([0,2\pi)\). The projectile passes precisely when \(d(\theta,\gamma)\leq\delta\).

Detecting Ring Crossings

A projectile moves radially inward at speed \(v\), so its radius after elapsed time \(\Delta t\) is

\[ r_{new}=r_{old}-v\Delta t. \]

Testing only whether \(r\) equals a ring radius would miss collisions whenever one frame steps across that exact value. Instead, a crossing occurs when \(r_{old}\geq R\) and \(r_{new}\leq R\), where \(R\) is the barrier radius. The angular gap test then decides whether the shot continues or is removed.

A Simpler Control Model

The original game used Caps Lock to select a ring and Control to modify its rotation. That mixed aiming with hidden barrier state and could not translate cleanly to touch input. Here, the barriers rotate autonomously. Pointer movement aims the ship, tapping the arena aims and fires in one action, and held left or right controls rotate the ship continuously. Arrow keys and Space provide the same actions without being the only way to play.

The timer, ring rotation, ship rotation, and projectile speed all use elapsed seconds rather than fixed work per frame. The game therefore behaves consistently across displays with different refresh rates and pauses without advancing any game state.