Play Gravity Wars
This is the 2002 PERL/Tk version of the game, ported to JavaScript so it runs right in your browser: same physics, same random battlefields, same ships. Two players take turns on the same computer or phone.
Game over
How to play
- Player 1 flies the Enterprise (the round disk with the red dot in the middle); player 2 flies the Klingon ship.
- On your turn, enter an angle and a speed, then press Fire (or Enter). Angles are in degrees: 0 is 3 o'clock and 90 is straight up. Speeds go from 0 to 10.
- The planets' gravity bends the torpedo's path. Colors show density: red is low, green is medium, and blue is high.
- If your torpedo hits a planet or leaves the planetary system, your turn is over. Hit the other ship to win, but be careful: you can also hit your own!
- Once in a while there are invisible black holes. From far away they act like a normal, medium-sized planet, but up close their gravity gets very strong.
- Redraw clears away old torpedo tracks. New Game makes a new random battlefield; press it until you get one you like.
The full rules and history are in the README, and the original PERL program is on the Gravity Wars page.
About this version
The physics, random setups, ship drawings, and controls are carried over from gravity_wars.pl. The differences: the torpedo now flies across the screen in real time (the PERL version only showed the path after calculating it), the battlefield is always 640×480 and shrinks to fit smaller screens, messages appear below the battlefield instead of on the console, and a torpedo stuck in orbit for 40 seconds ends the turn.