<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>PrimeShooter (TM)</title>

<script language="Javascript" src="PrimeShooter.js"></script>
<link rel="stylesheet" type="text/css" href="PrimeShooter.css" />

<!-- <script language="JavaScript" src="console.js"></script> -->

</head>

<body onload="setup(3);">
 <noscript><div class="noscript">If you can see this message it is because you have
disabled Javascript in your browser. You must turn Javascript on in order to use this interactive page.</div></noscript>

<h1>PrimeShooter<sup><small>TM</small></sup></h1>

<p class="byline">(version 22/3/2010)&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 2006-2010 <a href="http://thinkinghard.com/"><b>Philip Dorrell</b></a></p>

<p>See <a href="#instructions">below</a> for instructions.</p>

<div id="game"><!-- Game area -->
  <div id="score">Score: <span id="scoreValue">0</span></div><!-- Score display -->
  <div id="highScore">(No highscore)</div>

  <div id="gameOver"><!-- Game over message + restart button -->
    <div id="gameOverText">&nbsp;</div>
    <div id="startNewGameDiv"><input id="startNewGame" type="submit" value="Start New Game"/></div>
  </div>
  <div id="message">&nbsp;</div><!-- Message (when one gun is killed but game is not over) -->
  <div id="gun">&nbsp;</div><!-- Player's gun which shoots prime bullets -->
  <div id="bullet">nothing</div><!-- The bullet -->
  <div id="number0" class="number">number</div><!-- The numbers (up to 5 can be active) -->
  <div id="number1" class="number">number</div>
  <div id="number2" class="number">number</div>
  <div id="number3" class="number">number</div>
  <div id="number4" class="number">number</div>

  <div id="spareGuns"></div><!-- Spare gun display -->
</div>

<h3><a name="instructions">Instructions</a></h3>

<ul>

  <li>Use left and right arrow keys to move the gun left and right.</li>

  <li>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.</li>

  <li>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.</li>

  <li>If a number hits you, then you're dead.</li>

  <li>Sometimes, after a number goes below the bottom, and reappears at the top, it goes
a bright red, which means that it is <b>super-activated</b>. You have to kill a super-activated
number before it hits the bottom again, otherwise you'll be dead.</li>

  <li>Numbers come down more often as the score gets higher.</li>

  <li>You score 1 for each number you kill.</li>

  <li>Numbers range from 2 to 100, until the score goes over 50, when they range up to
(score + 50), with a maximum of 500.</li>

  <li>You start with 3 spare lives. You gain a new spare life for every 50 points,
unless you already have 10 spare lives.</li>

  <li>You can press <b>Esc</b> to manually terminate a game.</li>

  <li>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.</li>

  <li>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.</li>

</ul>

<h3>Change History</h3>

<ul>
  <li><b>31 March 06:</b> Moved to strict XHTML and got consistent behaviour in all 3 browsers.</li>
  <li><b>1 April 06:</b> Allow multiple lives</li>
  <li><b>5 April 06:</b> Remove link to console.js.</li>
 <li><b>29 August 07:</b> 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.)</li>
 <li><b>22 March 10:</b> If "local storage" is available in the web browser, store and display your personal high score.</li>
</ul>

<h3>Roadmap</h3>

<ul>
 <li>Port to <a href="http://haxe.org/">Haxe</a>, so it can be compiled to a SWF.</li>
  <li>Sounds (probably easier to do after porting to run on Flash platform)</li>
</ul>

<h3>Licence</h3>

<p>PrimeShooter<sup><small>TM</small></sup> is licensed under the <a href="gnu-general-public-license.txt">General Public License version 2</a>.</p>

<h3>Source Code</h3>

<p>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: 
<a href="PrimeShooter.html.txt">PrimeShooter.html</a> (as a text file), 
<a href="PrimeShooter.css">PrimeShooter.css</a> and
<a href="PrimeShooter.js">PrimeShooter.js</a>.</p>

<h3>Blog Article</h3>

<a href="../../blog/NotesOnWriting2DJavascriptVideoGame.html">This article</a> discusses some of
the issues that came up while developing this game.

<h4>Trademark</h4>

<p>Note: The General Public License version 2 doesn't say anything about trademark issues. 
I have marked "PrimeShooter" with the <sup><small>TM</small></sup> symbol to indicate that it is an
unregistered trade mark of myself (Philip Dorrell). Therefore, if you distribute an <i>altered</i>
or <i>derived</i> 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.
</p>

<hr/>
<a href="index.html">Back to Math Activities</a>

</body> </html>
