# PrimeShooterTM

(version 22/3/2010) Copyright © 2006-2010 Philip Dorrell

See below for instructions.

Score: 0
(No highscore)
nothing
number
number
number
number
number

### Instructions

- Use left and right arrow keys to move the gun left and right.
- You reduce a number by shooting it with its prime factors. Each time a prime factor hits a number, the number is divided by that factor. If the number is a prime number you can shoot it with a special "P" ("P" for "prime") missile which reduces it directly to 1.
- To fire a 2, 3, 5 or 7, just type the corresponding key on the keyboard. To fire 11, 13, 17 or 19, type the first letter of the number (in lower case), i.e. "e" for 11, "t" for 13, "s" for 17 and "n" for 19. Type "p" (lower case) to fire the "P" missile. In all cases a number is "dead" when it is reduced to 1.
- If a number hits you, then you're dead.
- Sometimes, after a number goes below the bottom, and reappears at the top, it goes a bright red, which means that it is super-activated. You have to kill a super-activated number before it hits the bottom again, otherwise you'll be dead.
- Numbers come down more often as the score gets higher.
- You score 1 for each number you kill.
- Numbers range from 2 to 100, until the score goes over 50, when they range up to (score + 50), with a maximum of 500.
- You start with 3 spare lives. You gain a new spare life for every 50 points, unless you already have 10 spare lives.
- You can press Esc to manually terminate a game.
- This game has been tested with the latest versions of Internet Explorer (6.0.2900), Mozilla Firefox (1.5.0.1) and Opera (8.52) running on Windows XP.
- The game now runs from a single file, so you can easily download it and run it locally. Note: On Internet Explorer you may have to "Allow Blocked Content ...", because, depending on your security settings, Internet Explorer can treat Javascript in a web page on your local disk as being dangerous.

### Change History

- 31 March 06: Moved to strict XHTML and got consistent behaviour in all 3 browsers.
- 1 April 06: Allow multiple lives
- 5 April 06: Remove link to console.js.
- 29 August 07: Speed up loop interval to make animation smoother. (If you have a slow computer this might make the whole game slower, but I'm betting that most players have a fast enough computer anyway.)
- 22 March 10: If local storage is available in the web browser, store and display high scores.

### Roadmap

- Port to Haxe, so it can be compiled to a SWF.
- Sounds (probably easier to do after porting to run on Flash platform)

### Licence

PrimeShooterTM is licensed under the General Public License version 2.

### Source Code

Being made from Javascript, CSS and HTML, there is no separate compilation step, i.e. everything is interpreted directly in the web browser. For convenience, here are some direct links to the source files: PrimeShooter.html (as a text file), PrimeShooter.css and PrimeShooter.js.

### Blog Article

This article discusses some of the issues that came up while developing this game.

#### Trademark

Note: The General Public License version 2 doesn't say anything about trademark issues. I have marked "PrimeShooter" with the TM symbol to indicate that it is an unregistered trade mark of myself (Philip Dorrell). Therefore, if you distribute an altered or derived version of the application, please give it a distinguishable name, for example "PrimeNumberShooter". You may refer to the fact that your altered version is derived from my original program. Of course, depending on what country you live in etc., an unregistered trademark may not be enforceable.

Back to Math Activities