"; $i++; } //print_r($highScoreArray); $newHighScore = false; $msg = " "; $displayMsg = false; //echo $score; $unique = true; for ($i = 0; $i < 10; $i++) { if ($score == $highScoreArray[$i]) { $unique = false; //echo "got one"; } //echo $highScoreArray[$i]; } if ($score == $scoreCheck && $encryptedScore == $encryptedScoreCheck) // valid score, only sent if it beats a score { if ($score > $highScoreArray[9] && $unique) { $highScore = $score; $newHighScore = true; } } elseif ($score > 0) { $msg = "Invalid encrypted score.

"; $displayMsg = true; } if ($newHighScore) { mysql_query("INSERT INTO HighScores (Score, Name) VALUES ('".$highScore."','".$name."')"); $result2 = mysql_query("SELECT * FROM HighScores ORDER BY Score ASC"); $row = mysql_fetch_array($result2); //will be smallest score $lowScore = $row['Score']; mysql_query("DELETE FROM HighScores WHERE `HighScores`.`Score` = '".$lowScore."' LIMIT 1"); //redo highscore listing $result3 = mysql_query("SELECT * FROM HighScores ORDER BY Score DESC"); //$row = mysql_fetch_array($result); //$highScore = $row['Score']; $highScoreArray = array(0,0,0,0,0,0,0,0,0,0); $names = array(0,0,0,0,0,0,0,0,0,0); $i = 0; while($row = mysql_fetch_array($result3)) { $highScoreArray[$i] = $row['Score']; $names[$i] = $row['Name']; //echo $row['Score']; //echo "
"; $i++; } } mysql_close($con); //$result = mysql_query("SELECT * FROM HighScores"); //echo $result; /* while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "
"; } */ $width = $_GET["width"]; $height = $_GET["height"]; $widthSet = "yes"; $heightSet = "yes"; if (!$width > 0 || !$height > 0) { $width = 775; $height = 569; $widthSet = "no"; $heightSet = "no"; } ?>
If you click outside of the screen, click back inside it to enable the controls again.
If the game is lagging for you, click here and it should be smoother.


Left and Right arrow keys: Move the paddle
X: Release the ball, fire laser, let go of ball when you have sticky powerup (green)
R: Tap to curve ball left when you have the god mode powerup (purple)
T: Tap to curve ball right when you have the god mode powerup (purple)
Esc: Sacrifice your current life and restart the stage
Ctrl: Hold Ctrl to move your paddle more slowly


Color: Power:
Blue Bigger paddle
Gray Smaller paddle
Green Sticky paddle
Pink Slowed ball
Purple God Mode (see controls)
Red Laser
Cyan Split 1 ball into 3 balls
Gold Unstoppable ball (doesn't bounce off blocks, just destroys them)

More Information:

Objective: Destroy all the blocks in each level without running out of lives.
There are currently a total of 12 stages.
You also get points for destroying blocks, getting powerups, and completing stages so try and beat my high score of 120640.
Every 25000 points you'll get an extra life.
Top 10 high scores are now saved, along with a name up to 8 letters long.

Silver blocks take two hits to destroy.
Gold blocks can't be destroyed (unless you have the unstoppable ball powerup).
You can only have one powerup at a time.
You'll also probably notice that the ball eventually speeds up, and this happens because of a slight increase in speed every time the ball bounces off something.

This was my final project for an introductory computer science class, CSCI 134, taken at Williams College in the fall of 2008.
Based off of the original Arkanoid game, which you can see at http://www.nintendo8.com/game/37/arkanoid/

Also, if you feel like playing around with some interactive physics simulations I programmed, go to:
Colliding balls (gravity and charge) or Solar System

Other random programs:
After giving a math colloquium talk on fractals I became interested in generating them, and
programmed this interactive fractal generator which can be fun to play around with:
With a little practice you can change the starting triangle into a fern. (This program is in many ways based
off of the program TeraFractal, a more professional one found at http://www.terafractal.com/,
but since I don't have a Mac, I wanted to make a version that would work on my PC.)

I'm currently taking a Math class, computational geometry, with a lot of connections to computer science,
so I've done a bit of programming of some of the topics we've looked at: Polygon Applet

Finally, for this same math class, I did a final project together with Todd Bustard on Robot Freeze Tag .

Questions, comments, or suggestions? Email me at 09cfb@williams.edu


2/27/09: Added round system so that after beating all 12 stages (2 new stages), you go
back to stage 1 and play with a smaller paddle (2/3 size) and faster ball (3/2 speed).
3/3/09: Fixed bug in paddle size when restarting game after losing with big or small powerup.
4/4/09: Added Buoyancy simulation: Buoyancy Applet
5/14/09: Added Robot Freeze Tag applet (see link above). I've also been updating it periodically to make it better.
5/18/09: Changed Arkanoid, Balls, and Solar System applets to not constantly requestFocusInWindow
and make it annoying to try and leave the website for some computers (macs I think).