Moving stuff around, nothing to see here

git-svn-id: https://aklabs.dyndns.org/svn/aklabs/trunk/games/wilysays@50 eb184899-6090-47d4-a65b-558f62f6ea1c
This commit is contained in:
andrew
2010-07-29 01:33:30 +00:00
commit c4ae376c8b
136 changed files with 6379 additions and 0 deletions

View File

@@ -0,0 +1,292 @@
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
// Given "WIN 2,0,0,11"
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
tempString = tempArray[1]; // "2,0,0,11"
versionArray = tempString.split(","); // ['2', '0', '0', '11']
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '<object ';
for (var i in objAttrs)
{
str += i + '="' + objAttrs[i] + '" ';
}
str += '>';
for (var i in params)
{
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
}
str += '</object>';
}
else
{
str += '<embed ';
for (var i in embedAttrs)
{
str += i + '="' + embedAttrs[i] + '" ';
}
str += '> </embed>';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}

View File

@@ -0,0 +1,52 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>simon says</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#000000" text="white">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<center><h2>CLICK <a href="http://www.aklabs.net/~akesterson/wilysays/help.html">HERE</a> FOR HELP!</h2></center>
<br/><br/>
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '640',
'height', '480',
'src', 'simon says',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'simon says',
'bgcolor', '#000000',
'name', 'simon says',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'simon says',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="640" height="480" id="simon says" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="simon says.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="simon says.swf" quality="high" bgcolor="#000000" width="640" height="480" name="simon says" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>

View File

@@ -0,0 +1,145 @@
<html>
<body bgcolor="black" text="white">
<center><h1>MEGA MAN: Wily Says!</h1>
<h2>HELP!</h2>
</center>
This is the help information for Mega Man: Wily Says!, the smash-megahit
game currently sweeping teh intarnets. Here's how to play the game.
<br/>
<center><img src="help1.png"></center>
<br/>
Once the game loads up, click inside the game window with your mouse to
make sure it has focus. Then hit your SPACE BAR. Click on one of the
difficulty setting buttons, to choose the difficulty. This determines
how many levels you play, and how long the patterns you're challenged with,
will be. Once you've done that, watch the intro; it'll give you a little
bit of background story, and a little bit of information on how to play
the game.
<center><h1>The interface</h1></center>
<br/>
<center><img src="help2.png"></center>
<br/>
<ul>
<li>The "SCORE" in the upper left corner of the window displays your current
total score. Higher scores mean you're more awesome, therefore higher scores
are better. You increase your score by completing more patterns.</li>
<li>The "TIMER" in the upper right corner of the window displays the amount of
time you have left to repeat the pattern. The timer may run faster or slower
depending on what difficulty setting you chose, as well as any powerups
you may or may not be using right then.</li>
<li>The numbered slots on the bottom left are your powerup slots. Hidden
inside the patterns are powerups; when you complete a pattern that has a
powerup associated with it, you get the powerup, and it shows up in one
of these numbered slots. To use one of the powerups, you can either click
on the powerup, or press the number key on your keyboard (non-numeric keypad)
above that powerup. Here are the powerups and what they do:
<br/><br/>
<table cols=3 cellspacing = 5>
<tr>
<td><b>Powerup Icon</b></td>
<td><b>Powerup Name</b></td>
<td><b>Powerup Effect</b></td>
</tr>
<tr>
<td><img src="gfx/EXCLAMATION.png"></td>
<td valign=bottom>SKIP</td>
<td valign=bottom>Skips the current pattern iteration you're on, and gives you all the score points for it</td>
</tr>
<tr>
<td><img src="gfx/FORGIVENESS.png"></td>
<td valign=bottom>FORGIVENESS</td>
<td valign=bottom>If you have a FORGIVENESS in your inventory, and you mess up a pattern, then you don't have to start over on a new pattern; it's as if the mistake never happened.</td>
</tr>
<tr>
<td><img src="gfx/POINTDOUBLER.png"></td>
<td valign=bottom>POINT DOUBLER</td>
<td valign=bottom>When this powerup is used, the current pattern iteration will give you double the number of points it normally would have.</td>
</tr>
<tr>
<td><img src="gfx/SLOWDOWN.png"></td>
<td valign=bottom>SLOW DOWN</td>
<td valign=bottom>When this powerup is used, the timer runs at an incredibly slow speed, virtually stopping.</td>
</tr>
</table>
</li>
<li> The "ATTEMPTS REMAINING" at the bottom right will show many lives
you have left. Every time you miss a light on a pattern, you will
lose one life. When you reach 0 lives, the lock will self-detonate,
and you will experience the crushing failure that is Game Over.</li>
<li>The red lights on the right side of the screen indicate the total
number of lights in this pattern; for example, if there are 3
red lights, then this pattern has 3 lights to its combination.
Therefore you will have one iteration with one light, one
iteration with 2 lights, and one iteration with 3 lights.
We all remember how a Simon Says works, right?
As you complete iterations, those iterations will turn lights
from red to green, showing how far away you are from completing
the lock/pattern and progressing to the next level.</li>
<li>The thing that looks like a Simon Says in the middle of the screen
isn't actually a simon says. Yeah, I know - I know, it looks
like one, but it's *not*. It's called the WilyLok, "an ingenious
pattern-based locking mechanism" designed to keep Mega Man
out of Dr Wily's laboratory while he destroys the world.
This is where most of the gameplay happens. All you have to do
is press the lighted buttons in the same pattern that they
flash. All 4 lights will flash once, and then the lights you
need to press will light individually. Then all 4 lights
will flash again, and the timer will start ticking.
Now you have to click on the lights in the same pattern that
you just watched. Failure to do so will explode your skull
and you'll lose a life - and what's worse, you'll have to
start over.</li>
</ul>
Simple, right?
<center><h2>Credits</h2></center>
<pre>
Pre-formatting this because I'm lazy.
Most of this was assembled ad-hoc from various places around the internet
for a game demo to accompany a resume, so it was never really intended for
public consumption. But before the whole thing was over, it just became
so ridiculous I couldn't possibly keep it to myself.
The theme music is a MIDI version of Depeche Mode's "Master and Servant". That's
where the name "Mastermind" for the Simon Says came from.
The graphics were mostly stolen from mega man fansites around the internet.
The explosion graphic was lifted from someone. I forget who. It's the same
one I used in my "HOLY *@#%! ALIENS!" space shooter demo.
The sound effects, again, were lifted from various free sites around the
net. I honestly didn't keep track of them. I know they were all straight off
Google links.
I'm solely responsible for this atrocity; if you want to send me hate mail,
you're a megaman purist and you want to tear off my head, you think this was
the most ridiculous idea for a game demo ever, or if you want to send me
big buckets of money because I'm just so <i>goddamned AWESOME</i>, send mail
to andrew@aklabs.net, or follow me on twitter (@akesterson). Thanks.
The entire demo was coded in ActionScript 3 on Adobe Flash CS3, graphics
were chopped up with The GIMP, sounds composed/trimmed in Audacity. I think
I spent about a total of 48 hours on this project, and that includes learning
ActionScript 3. I'll release the source in a few days after an employer
is done looking at it.
</pre>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

View File

@@ -0,0 +1,134 @@
<?php
$db = mysql_connect("localhost", "akesterson", "fadmin");
if ( !$db ) {
die("Unable to connect to mysql database");
}
mysql_select_db("akesterson", $db);
if ( isset($_REQUEST["op"]) ) {
if ( strcmp($_REQUEST["op"], "store") == 0 ) {
$query = ("INSERT INTO wilysays_highscores (score, name, maxpattern, dtime) VALUES (" .
(int)$_REQUEST["score"] . ", \"" . mysql_real_escape_string($_REQUEST["name"]) . "\", " . (int)$_REQUEST["maxpattern"] . ", NOW() );");
//printf($query);
$res = mysql_query($query, $db);
if ( !$res )
die("Unable to insert into the database - WTF?. " . mysql_error($db));
printf("<html><body>\n<center>Groovy</center>\n</body></html>");
}
die();
}
?>
<html>
<body bgcolor="black" text="white">
<center>
<h1>MEGA MAN: Wily Says!</h1>
<h3>Leaderboards</h3>
<h4>Click <a href="http://www.aklabs.net/~akesterson/wilysays/game.html">HERE</a> to play the mega-hit game!</h4>
<h4>Click <a href="http://www.aklabs.net/~akesterson/wilysays/help.html">HERE</a> for instructions on HOW to play the mega-hit game!</h4>
</center>
<table cols=3 align="center" >
<tr>
<td valign="top" width="171" ><img src="megaman.png"/></td>
<td valign="top" >
<?php
$totalRows = 0;
$curPage = 0;
$rowsPerPage = 5;
$sortOrder = 1;
if ( isset($_REQUEST["perpage"]) ) {
$rowsPerPage = (int)$_REQUEST["perpage"];
}
if ( isset($_REQUEST["start"]) ) {
$curPage = ((int)$_REQUEST["start"])/$rowsPerPage;
}
if ( isset($_REQUEST["sort"]) ) {
$sortOrder = (int)$_REQUEST["sort"];
}
$totalPages = $totalRows/$rowsPerPage;
$query = "SELECT COUNT(*) AS count FROM wilysays_highscores;";
$res = mysql_query($query, $db);
if ( $res ) {
$row = mysql_fetch_array($res);
$totalRows = $row["count"];
}
$query = "SELECT * FROM wilysays_highscores";
if ( $sortOrder == 0 ) {
$query .= " ORDER BY name ASC";
} else if ( $sortOrder == 1 ) {
$query .= " ORDER BY score DESC ";
} else if ( $sortOrder == 2 ) {
$query .= " ORDER BY maxpattern DESC ";
} else if ( $sortOrder == 3 ) {
$query .= " ORDER BY dtime DESC ";
}
$query .= " LIMIT " . $rowsPerPage . " OFFSET " . ($curPage*$rowsPerPage) . ";";
///printf($query);
$res = mysql_query($query, $db);
if ( $res ) {
printf("\t\t\t<table align=center cols=4 width=440 border=1>\n");
printf("<tr>\n");
if ( $curPage > 0 )
printf(" <td colspan=2 align=left><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?perpage=%d&start=%d\">&lt;&lt; PREVIOUS</td>\n", $rowsPerPage, (($curPage*$rowsPerPage)-$rowsPerPage));
else
printf(" <td colspan=2></td>\n");
if ( $totalRows > ($curPage * $rowsPerPage) )
printf(" <td colspan=2 align=right><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?perpage=%d&start=%d\">NEXT &gt;&gt;</a></td>\n", $rowsPerPage, (($curPage*$rowsPerPage)+$rowsPerPage));
else
printf(" <td colspan=2></td>\n");
printf("</tr>\n");
printf("\t\t\t\t<tr><td><b><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?start=%d&sort=0\">Player<br/>Name</a></b></td><td><b><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?start=%d&sort=1\">Total<br/>Score</a></b></td><td><b><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?start=%d&sort=2\">Longest<br/>Pattern</a></b></td><td><b><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?start=%d&sort=3\">When<br/>Recorded</a></b></td></tr>\n",
($curPage*$rowsPerPage), ($curPage*$rowsPerPage), ($curPage*$rowsPerPage), ($curPage*$rowsPerPage));
while ( $row = mysql_fetch_array($res) ) {
printf("\t\t\t\t<tr>\n");
printf("\t\t\t\t\t<td>" . $row["name"] . "</td>\n");
printf("\t\t\t\t\t<td>" . $row["score"] . "</td>\n");
printf("\t\t\t\t\t<td>" . $row["maxpattern"] . "</td>\n");
printf("\t\t\t\t\t<td>" . $row["dtime"] . "</td>\n");
printf("\t\t\t\t</tr>\n");
}
printf("<tr>\n");
if ( $curPage > 0 )
printf(" <td colspan=2 align=left><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?perpage=%d&start=%d\">&lt;&lt; PREVIOUS</td>\n", $rowsPerPage, (($curPage*$rowsPerPage)-$rowsPerPage));
else
printf(" <td colspan=2></td>\n");
if ( $totalRows > ($curPage * $rowsPerPage) )
printf(" <td colspan=2 align=right><a href=\"http://www.aklabs.net/~akesterson/wilysays/index.php?perpage=%d&start=%d\">NEXT &gt;&gt;</a></td>\n", $rowsPerPage, (($curPage*$rowsPerPage)+$rowsPerPage));
else
printf(" <td colspan=2></td>\n");
printf("</tr>\n");
printf("\t\t\t</table>\n");
}
?>
</td>
<td valign="top" ><img src="wily.png"/></td>
</tr>
</table>
<center>
<br/><br/><i>"A fabulous tour de force..." -- Game Misinformer Bragazine</i>
<br/><br/><i>"Quite possibly the most important thing to happen to
<br/>video games since Shigeru Miyamoto." -- Protendo Trading Cards</i>
<br/><br/><i>"I believe we made the most beautiful thing in the world. Nobody
<br/>would criticize a renowned architect's blueprint that the position
<br/>of a gate is wrong. It's the same as that." --Ken Kutaragi</i>
</center>
</body>
</html>