From f8c9eb5220afaf2f9a62f9a176a45913240f4081 Mon Sep 17 00:00:00 2001 From: raylu Date: Thu, 7 Apr 2011 00:27:27 -0400 Subject: Initial import from Dropbox --- changelog/changelog.txt | 202 +++++++++ changelog/datascheme.sql | 82 ++++ css/mapstyle.css | 384 +++++++++++++++++ css/pagestyle.css | 61 +++ css/statsstyle.css | 25 ++ do.php | 255 +++++++++++ errors.php | 15 + globe.php | 157 +++++++ images/Old Images/GameIdea.bmp | Bin 0 -> 967430 bytes images/Old Images/GameIdea.jpg | Bin 0 -> 53085 bytes images/Old Images/mazetd graphics.jpg | Bin 0 -> 109082 bytes images/Old Tiles/OverlayA50.png | Bin 0 -> 3897 bytes images/Old Tiles/OverlayB50.png | Bin 0 -> 3986 bytes images/Old Tiles/OverlayC50.png | Bin 0 -> 3765 bytes images/Old Tiles/OverlayD50.png | Bin 0 -> 3813 bytes images/Old Tiles/OverlayE50.png | Bin 0 -> 3820 bytes images/Old Tiles/TeleportInAni.gif | Bin 0 -> 2140 bytes images/Old Tiles/TeleportInAniOld.gif | Bin 0 -> 711 bytes images/Old Tiles/TeleportInAnib.gif | Bin 0 -> 1208 bytes images/Old Tiles/TeleportOutAni.gif | Bin 0 -> 1713 bytes images/Old Tiles/TeleportOutAniB.gif | Bin 0 -> 863 bytes images/Old Tiles/TeleportOutAniOld.gif | Bin 0 -> 732 bytes images/OverlayA50.png | Bin 0 -> 3553 bytes images/OverlayA50ss.png | Bin 0 -> 3435 bytes images/OverlayB50.png | Bin 0 -> 3523 bytes images/OverlayB50ss.png | Bin 0 -> 3473 bytes images/OverlayC50.png | Bin 0 -> 3592 bytes images/OverlayC50ss.png | Bin 0 -> 3612 bytes images/OverlayD50.png | Bin 0 -> 3522 bytes images/OverlayD50ss.png | Bin 0 -> 3427 bytes images/OverlayE50.png | Bin 0 -> 3486 bytes images/OverlayE50ss.png | Bin 0 -> 3178 bytes images/OverlayStart50.png | Bin 0 -> 1270 bytes images/OverlayStart50i.png | Bin 0 -> 1424 bytes images/OverlayTeleport.png | Bin 0 -> 3042 bytes images/OverlayTeleport.xcf | Bin 0 -> 2574 bytes images/OverlayTile10.png | Bin 0 -> 2266 bytes images/OverlayTile20.png | Bin 0 -> 2419 bytes images/OverlayTile30.png | Bin 0 -> 2531 bytes images/OverlayTile50.png | Bin 0 -> 2781 bytes images/OverlayTileFaceted10.png | Bin 0 -> 2563 bytes images/OverlayTileFaceted20.png | Bin 0 -> 2757 bytes images/OverlayTileFaceted30.png | Bin 0 -> 2851 bytes images/OverlayTileFaceted50.png | Bin 0 -> 3056 bytes images/OverlayTiles.xcf | Bin 0 -> 34075 bytes images/Path1.png | Bin 0 -> 1577 bytes images/Path2.png | Bin 0 -> 1424 bytes images/Path3.png | Bin 0 -> 1459 bytes images/Path4.png | Bin 0 -> 1812 bytes images/Teleport1.png | Bin 0 -> 256 bytes images/Teleport2.png | Bin 0 -> 262 bytes images/Teleport3.png | Bin 0 -> 261 bytes images/Teleport4.png | Bin 0 -> 261 bytes images/TeleportIn.png | Bin 0 -> 3245 bytes images/TeleportInW.png | Bin 0 -> 3428 bytes images/TeleportOut.png | Bin 0 -> 3261 bytes images/TeleportOutW.png | Bin 0 -> 3436 bytes includes/datas.php | 1 + includes/db.inc.php | 11 + includes/header.php | 67 +++ includes/mapoftheday.php | 1 + includes/maps.php | 743 +++++++++++++++++++++++++++++++++ includes/openid.php | 740 ++++++++++++++++++++++++++++++++ includes/pathing.php | 108 +++++ index.php | 90 ++++ js/ajax.js | 195 +++++++++ js/mapspecs.js | 688 ++++++++++++++++++++++++++++++ pages/.htaccess | 1 + pages/about.php | 32 ++ pages/admin.php | 233 +++++++++++ pages/cp.php | 69 +++ pages/faq.php | 43 ++ pages/gallery.php | 113 +++++ pages/home.php | 167 ++++++++ pages/howtoplay.php | 102 +++++ pages/leaderboard.php | 236 +++++++++++ pages/login.php | 117 ++++++ pages/memberlist.php | 91 ++++ pages/test.php | 408 ++++++++++++++++++ sound-config.xml | 20 + soundcontroller.swf | Bin 0 -> 2015 bytes sounds/beep.mp3 | Bin 0 -> 6312 bytes sounds/bling.mp3 | Bin 0 -> 38528 bytes sounds/blip.mp3 | Bin 0 -> 5686 bytes sounds/cap.mp3 | Bin 0 -> 3200 bytes sounds/charm.mp3 | Bin 0 -> 10368 bytes sounds/click.mp3 | Bin 0 -> 4736 bytes sounds/cosmic002.mp3 | Bin 0 -> 26752 bytes sounds/cosmic003.mp3 | Bin 0 -> 193664 bytes sounds/hologram.mp3 | Bin 0 -> 42112 bytes sounds/page.mp3 | Bin 0 -> 11119 bytes sounds/script/demo.js | 11 + sounds/script/soundmanager.js | 182 ++++++++ sounds/select.mp3 | Bin 0 -> 7248 bytes sounds/transmission.mp3 | Bin 0 -> 4224 bytes sounds/ufoblip.mp3 | Bin 0 -> 11904 bytes 96 files changed, 5650 insertions(+) create mode 100644 changelog/changelog.txt create mode 100644 changelog/datascheme.sql create mode 100644 css/mapstyle.css create mode 100644 css/pagestyle.css create mode 100644 css/statsstyle.css create mode 100644 do.php create mode 100644 errors.php create mode 100644 globe.php create mode 100644 images/Old Images/GameIdea.bmp create mode 100644 images/Old Images/GameIdea.jpg create mode 100644 images/Old Images/mazetd graphics.jpg create mode 100644 images/Old Tiles/OverlayA50.png create mode 100644 images/Old Tiles/OverlayB50.png create mode 100644 images/Old Tiles/OverlayC50.png create mode 100644 images/Old Tiles/OverlayD50.png create mode 100644 images/Old Tiles/OverlayE50.png create mode 100644 images/Old Tiles/TeleportInAni.gif create mode 100644 images/Old Tiles/TeleportInAniOld.gif create mode 100644 images/Old Tiles/TeleportInAnib.gif create mode 100644 images/Old Tiles/TeleportOutAni.gif create mode 100644 images/Old Tiles/TeleportOutAniB.gif create mode 100644 images/Old Tiles/TeleportOutAniOld.gif create mode 100644 images/OverlayA50.png create mode 100644 images/OverlayA50ss.png create mode 100644 images/OverlayB50.png create mode 100644 images/OverlayB50ss.png create mode 100644 images/OverlayC50.png create mode 100644 images/OverlayC50ss.png create mode 100644 images/OverlayD50.png create mode 100644 images/OverlayD50ss.png create mode 100644 images/OverlayE50.png create mode 100644 images/OverlayE50ss.png create mode 100644 images/OverlayStart50.png create mode 100644 images/OverlayStart50i.png create mode 100644 images/OverlayTeleport.png create mode 100644 images/OverlayTeleport.xcf create mode 100644 images/OverlayTile10.png create mode 100644 images/OverlayTile20.png create mode 100644 images/OverlayTile30.png create mode 100644 images/OverlayTile50.png create mode 100644 images/OverlayTileFaceted10.png create mode 100644 images/OverlayTileFaceted20.png create mode 100644 images/OverlayTileFaceted30.png create mode 100644 images/OverlayTileFaceted50.png create mode 100644 images/OverlayTiles.xcf create mode 100644 images/Path1.png create mode 100644 images/Path2.png create mode 100644 images/Path3.png create mode 100644 images/Path4.png create mode 100644 images/Teleport1.png create mode 100644 images/Teleport2.png create mode 100644 images/Teleport3.png create mode 100644 images/Teleport4.png create mode 100644 images/TeleportIn.png create mode 100644 images/TeleportInW.png create mode 100644 images/TeleportOut.png create mode 100644 images/TeleportOutW.png create mode 100644 includes/datas.php create mode 100644 includes/db.inc.php create mode 100644 includes/header.php create mode 100644 includes/mapoftheday.php create mode 100644 includes/maps.php create mode 100644 includes/openid.php create mode 100644 includes/pathing.php create mode 100644 index.php create mode 100644 js/ajax.js create mode 100644 js/mapspecs.js create mode 100644 pages/.htaccess create mode 100644 pages/about.php create mode 100644 pages/admin.php create mode 100644 pages/cp.php create mode 100644 pages/faq.php create mode 100644 pages/gallery.php create mode 100644 pages/home.php create mode 100644 pages/howtoplay.php create mode 100644 pages/leaderboard.php create mode 100644 pages/login.php create mode 100644 pages/memberlist.php create mode 100644 pages/test.php create mode 100644 sound-config.xml create mode 100644 soundcontroller.swf create mode 100644 sounds/beep.mp3 create mode 100644 sounds/bling.mp3 create mode 100644 sounds/blip.mp3 create mode 100644 sounds/cap.mp3 create mode 100644 sounds/charm.mp3 create mode 100644 sounds/click.mp3 create mode 100644 sounds/cosmic002.mp3 create mode 100644 sounds/cosmic003.mp3 create mode 100644 sounds/hologram.mp3 create mode 100644 sounds/page.mp3 create mode 100644 sounds/script/demo.js create mode 100644 sounds/script/soundmanager.js create mode 100644 sounds/select.mp3 create mode 100644 sounds/transmission.mp3 create mode 100644 sounds/ufoblip.mp3 diff --git a/changelog/changelog.txt b/changelog/changelog.txt new file mode 100644 index 0000000..4489604 --- /dev/null +++ b/changelog/changelog.txt @@ -0,0 +1,202 @@ +================= +== NamePending == +================= +04-04-11 + Setup the leaderboard to show every solution from yesterday. - Snap + Modified loadSol() JS function to support other calls. - Snap + Added col1 and col2 classes for the columns. They're now used on the homepage and leaderboard page. - raylu + The leaderboard specific CSS is in statsstyle.css. It's currently included on all pages, unfortunately. - raylu + Cleaned up the leaderboard.php code duplication. - raylu + Added some Javascript to only show one stats section at a time on the leaderboard page. - raylu + +04-03-11 + Fixed a database related issue, solution size was insuffecient. - Snap + Preferences for mute/speed is now saved - Snap + Facebook page semi-started (awaiting name?) - Snap + +03-28-11 - 03-31-11 + Added maps-per-day. - Snap + A few map-types designed and added. - Snap + Added deny all .htaccess to /pages. - Snap + +03-27-11 + Added yesterdays best solution to leaderboard. - Snap + +03-26-11 (Back from vacation) + do.php now confirms that it is a current map. - Snap + isCurrentMap() function added to do.php + Moved $Links array to index.php. - Snap + Fixed an issue with generating links before cookielogin. + The logic of having them next to where it checks for those links is better too. + +03-16-11 + Fixed an issue with the leaderboard. - Snap + +03-15-11 + Some spelling/grammar fixes in how to play. -raylu + Redid the layout. -raylu + There is no navigation bar anymore; everything is in the top bar. + There are now two float:left divs with widths 25%, 50% on the homepage. This gives the + illusion that the second one is "centered." + Fixed a lot of issues with the animated path. - Snap + +03-14-11 + Added cp.php, control-panel. - Snap + Allows users to change their displayname. + Link for now is located on their displayname, top right. + Fixed an issue where pathing didn't like to overlap. - Snap + +03-13-11 + Turned the Speed into a dropdown. -Snap (Thanks Rory) + Login Logout top-bar added. - Snap + Your personal best solution is loaded for the map. - Snap + Leaderboard added. - Snap + Logout link removed from nav, but login link kept. (makes sense, right?) - Snap + +03-12-11 + Tons if little changes to the UI. -Snap + +03-11-11 + Cookie login method added; session data is rebuilt. - Snap + !~ Auth is not dependent on a time frame, this will need to be fixed. + Cookies are deleted on logout. + MapCode is now requested from the database, rather than using the exploitable JS code. - Snap + Implemented "formSolution" function into do.php; - Snap + Now identical solutions will appear identical. + This could be useful in the future, but only if this is implemented now. + +03-10-11 + Updated our pipeline.txt - Snap + Added notification of when you beat or tie a record. - Snap + Fixed unusual bug where hitting a target could cause an issue with the counter-box. - Snap + Added datas.php for SQL statistical output. - Snap + Started topscores PHP function. + + +03-09-11 + Fixed a bug with reset button leaving shadows. - Snap (ty, everyone who mentioned that) + Added blink to teleport tiles when in use. - Snap + Test Path button is now disabled for the duration of the animation. - Snap + Started the 'How To Play' page: - Snap + Added optional arguement $example boolean = false to the PHP displayMap function. + When true, speed is set to slow, and the border-data is removed. + Fixed a height issue with smaller maps, which has been effecting other maps too. - Snap + Many improvements made to the "doAnimate" function. - Snap + +03-08-11 + Fixed a bug when removing blocks could currupt the solution. - Snap + The animated path now goes 'over' special squares, instead of hoping over them. - Snap + New function mapOfTheDay(TYPE). - Snap + Returns the map created for that TYPE or generates one that day. + TYPES; 1 2 3 4, easy normal hard random. Default: random. + new types are created very easily, I.E. $motd = mapOfTheDay(5); will generate the map, unless existing that day. + To set custom definitions for that map, just add a case in mapOfTheDay's switch $type. + +03-07-11 + Fixed a bug special where the path could be blocked by blocking a teleport OUT. - Snap (thanks Light) + (Special because other rare conditions had to be met too); + Tweaked game border-data. - Snap + Nice lookin IN and OUT tiles made. - Rex + +03-03-11 - 03-06-11 + Tweaked colors. - Snap + Changed how javascript handled teleports. and gray-ed out teleports. - Snap + Pathing now goes INTO the teleport in - rather than teleporting before reaching TPin. - Snap + A required change for the animation to properly locate the teleport-in square. + Note; this change will add +1 moves per used-teleport in some solutions. + Added sounds. Snap + Added slow-med-fast animation. Snap + Added gray-out checkpoints. Snap + mapcode format changed - see documentation.txt. - Snap + +03-02-11 + Started recording peoples best solution. - Snap + Login added. - Snap + Pages and links prepared. - Rex + Header navigation started. - Rex + mapoftheday.php and function mapOfTheDay() added; - Snap + Database tables added; maps, users, solutions - Snap + +03-01-11 + Added 'Reset Walls' button. - Snap + Once again fixed a counting issue with PHP... - Snap + Contained mazes to allow for unlimited mazes to be displayed, animated and solved. - Snap + + +02-28-11 + Fixed an issue where pathing could run into mapMatrix[0] (headers) - Snap + DisplayMap now sneaks in a hidden div containing JSON data for wall count & etc. - Snap + $numBlocks arguement changed to optional, default -1 for random. - Snap + Random odds currently set to: + $numBlocks = Rand(7, (int)($rows * $cols) * .12); + Many, many bug fixes related to having 0 checkpoints & alike. - Snap + Fixed snake-color issue adjustable checkpoints. -Snap + Routepath correctly handles different amount of checkpoints. - Snap + GenerateMap now has 2 optional arguements for checkpoints and teleports. + -1 - 5, -1 - 2, default -1 - which is random. - Snap + Fixed an issue where php's movecount was off. - Snap + Added checkpoints "d" and "e" - Snap + Set the "snake"'s color the same as it's next target. - Snap + +02-27-11 + Added 2nd teleport, and solved the many issues that arised with it. - Snap + Solved an issue where the javascript animation caused mapdistoration due to non-set width/height. - Snap + Fixed move-count when effected by teleports - Snap + +02-26-11 + Discovered that if you block the teleport-out square, it jumps to the next target... - Snap + bewildered by the fact that my code didn't fail, perhaps we should leave it as is? + Semi-implemented arrow-snake. - Snap + More attractive images added. - Rex + +02-25-11 (Updates from previous days) + Added ValidateMap($mapMatrix) function. - Snap + Started a database, no tables. - Snap + contact Snap for DB access. + A sweet teleport 't' and 'u' added! w00 h00! - Snap (w/ help). + Updated Pathing to support multiple start locations. (['start'] = 'y,x' of start location) - Snap + Finished update on javascript to support multiple start locations. - Snap + Completed pathing. - Snap + Updated visuals. + Edited CSS for .grid_table. - Rex + Added Website Diagram to /Changelog. - Rex + + +02-22-11 + Modified MergeMapSolution function - Snap + Added optional $idprefix to DisplayMap, to allow for multiple maps on the same page. - Snap + Added required mapid to AnimatePath(path, mapid) - Snap + Added solution array, and blocks array, for multiple maps - Snap + Added alternate prefixes to CSS Transitions, sadly firefox doesn't support this property + but, it still looks good without it. (Opera & Netscape some others do). + Started work on gallery. - Snap + +02-21-11 + Started work on AJAX (do.php & home.php). -Snap + Added function MergeMapSolution(Map, Solution) -Snap + Added JS function AnimatePath(PATHCODE) Fairly pretty :) -Snap + Had a lot of fun with css transitions. + Worked on FindPath function -Rex + +02/20/11 + $mapMatrix[0] now holds header data + Edited GenerateMapCode - added more headers and adjusted loop + Created GenerateMapByCode function. + Created GetTile function. (Not working) + Fixed Checkpoint spawn + Fixed an issue regarding an extra column being generated in GenerateMap + +Snap 02/19/11 + + Added headers to GenerateMapCode + Temporarly moved Functions GenerateMapCode & GenerateMap to map.php + Created DisplayMap function + Lots of little things. + + +02/18/11 +In Concept. + + + + diff --git a/changelog/datascheme.sql b/changelog/datascheme.sql new file mode 100644 index 0000000..bb00b23 --- /dev/null +++ b/changelog/datascheme.sql @@ -0,0 +1,82 @@ +-- phpMyAdmin SQL Dump +-- version 3.3.8.1 +-- http://www.phpmyadmin.net +-- +-- Host: db2838.perfora.net +-- Generation Time: Mar 15, 2011 at 07:14 PM +-- Server version: 5.0.91 +-- PHP Version: 5.2.17 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `db358894438` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `mapOfTheDay` +-- + +CREATE TABLE `mapOfTheDay` ( + `ID` int(11) NOT NULL auto_increment, + `mapID` int(11) NOT NULL, + `mapType` tinyint(4) NOT NULL, + `mapDate` date NOT NULL, + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `maps` +-- + +CREATE TABLE `maps` ( + `ID` int(11) NOT NULL auto_increment, + `code` varchar(512) collate latin1_general_ci NOT NULL, + `dateCreated` timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `solutions` +-- + +CREATE TABLE `solutions` ( + `ID` int(11) NOT NULL auto_increment, + `userID` int(11) NOT NULL, + `mapID` int(11) NOT NULL, + `solution` varchar(128) collate latin1_general_ci NOT NULL, + `moves` int(11) NOT NULL, + `dateModified` timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (`ID`), + KEY `userID` (`userID`,`mapID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +CREATE TABLE `users` ( + `ID` int(11) NOT NULL auto_increment, + `openID` varchar(255) collate latin1_general_ci NOT NULL, + `email` varchar(128) collate latin1_general_ci NOT NULL, + `displayName` varchar(64) collate latin1_general_ci NOT NULL, + `dateLogin` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `dateJoined` timestamp NOT NULL default '0000-00-00 00:00:00', + `isAdmin` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`ID`), + UNIQUE KEY `openID` (`openID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; diff --git a/css/mapstyle.css b/css/mapstyle.css new file mode 100644 index 0000000..77a8089 --- /dev/null +++ b/css/mapstyle.css @@ -0,0 +1,384 @@ +.grid_dsp_data { + padding:1px; + font-style:italic; + font-weight:bold; +} + +.grid_outer +{ + position:relative; + padding: 0px; + margin-top: 10px; + margin-bottom: 60px; + padding-top:2px; + padding-bottom:10px; + margin-left:auto; + margin-right:auto; + border-top: 1px solid #000; + border-left: 1px solid #000; + border: 0px solid #000; + background-color: #333399; +} +.grid_outer a +{ + color: #FFFF33; +} + + +.dsp_33 { + width:32%; +} +.dsp_49 { + width:49%; +} +.dsp_24 { + width:23%; +} +.dsp_16 { + width:16%; +} + +.grid_dsp_left, +.grid_dsp_mid, +.grid_dsp_right { + overflow: none; + position:relative; + float: left; + padding:2px; + color: #FFFFFF; +} +.grid_dsp_left { + text-align:left; + align:left; +} +.grid_dsp_mid { + text-align:center; +} +.grid_dsp_right { + text-align:right; +} + +.grid_img { + padding: 0px; + margin: 0px; + border: 0px; + border-spacing: 0px; + width: 36px; + height: 35px; +} + + +.grid_table +{ + position:relative; + padding: 0px; + margin-top:1px; + margin-bottom:1px; + margin-left:auto; + margin-right:auto; + border-top: 0px solid #000; + border-left: 0px solid #000; + border: 1px solid #000; + border-spacing: 0px; +} +.grid_table td, .grid_table th { + padding: 0px; + margin: 0px; +} +.grid_td, +.grid_td_rocks, .grid_td_walls, +.grid_td_start, .grid_td_finish, +.grid_td_cpa, .grid_td_cpb, .grid_td_cpc, +.grid_td_cpd, .grid_td_cpe, +.grid_td_animate, .grid_td_animate_pre, +.grid_td_tp1_in, .grid_td_tp2_in, .grid_td_tp3_in, .grid_td_tp4_in, .grid_td_tp5_in, +.grid_td_tp1_out, .grid_td_tp2_out, .grid_td_tp3_out, .grid_td_tp4_out,.grid_td_tp5_out, +.grid_td_path1 , .grid_td_path2, .grid_td_path3, .grid_td_path4 +{ + padding: 0px; + margin: 0px; + border: 0px; + border-right: 0px solid #000; + border-bottom: 0px solid #000; + + overflow: hidden; + font-size: 4px; + line-height:9px; + width: 35px; + /* width: 22px; */ + height: 35px; + min-height: 1px; + background: url(../images/OverlayTileFaceted50.png); + background-size: 100%; + transition:background-color 0s; + -webkit-transition:background-color 0s; + -o-transition:background-color 0s; + -moz-transition:background-color 0s; +} +.grid_td +{ + background: #F5FBFE url(../images/OverlayTile10.png); +} +.grid_td:hover +{ + background: #CCCCCC url(../images/OverlayTileFaceted10.png); +} +.grid_td_pressed { + background: #111122; +} + +.grid_td_rocks { + background: #b85555 url(../images/OverlayTileFaceted50.png); +} +.grid_td_walls { + background-color: #777; + background: url(../images/OverlayTileFaceted50.png); + transition:background-color 1.6s ease-out; + -webkit-transition:background-color 1.6s ease-out; + -o-transition:background-color 1.6s ease-out; + -moz-transition:background-color 1.6s ease-out; +} +.grid_td_walls:hover { + background: #CCCCCC url(../images/OverlayTileFaceted30.png); + background-color: #999; +} + +.grid_td_start { + background: url(../images/OverlayStart50i.png); + background-color: #F75555; +} +.grid_td_finish { + background: url(../images/OverlayStart50.png); + background-color: #6666FF; + color: #fff; +} + + +.grid_td_tp1_in, .grid_td_tp2_in, .grid_td_tp3_in, .grid_td_tp4_in, .grid_td_tp5_in, +.grid_td_tp1_out, .grid_td_tp2_out,.grid_td_tp3_out, .grid_td_tp4_out,.grid_td_tp5_out, +.grid_td_cpa, .grid_td_cpb, .grid_td_cpc, .grid_td_cpd, .grid_td_cpe +{ + transition:background-color 2s; + -webkit-transition:background-color2s; + -o-transition:background-color 2s; + -moz-transition:background-color 2s; +} + +.no_transition { + transition:background-color 0s; + -webkit-transition:background-color 0s; + -o-transition:background-color 0s; + -moz-transition:background-color 0s; +} + + + +.grid_td_tp1_in { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportInW.png); + background-color: #3377AA; +} +.grid_td_tp1_out { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportOutW.png); + background-color: #3377AA; +} +.grid_td_tp2_in { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportIn.png); + background-color: #44EE66; +} +.grid_td_tp2_out { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportOutAni.gif); */ + background: url(../images/TeleportOut.png); + background-color: #44EE66; +} +.grid_td_tp3_in { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportInW.png); + background-color: #992200; +} +.grid_td_tp3_out { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportOutAni.gif); */ + background: url(../images/TeleportOutW.png); + background-color: #992200; +} +.grid_td_tp4_in { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportIn.png); + background-color: #55CCFF; +} +.grid_td_tp4_out { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportOutAni.gif); */ + background: url(../images/TeleportOut.png); + background-color: #55CCFF; +} +.grid_td_tp5_in { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportInAni.gif); */ + background: url(../images/TeleportInW.png); + background-color: #005533; +} +.grid_td_tp5_out { + /* background: url(../images/OverlayTeleport.png),url(../images/TeleportOutAni.gif); */ + background: url(../images/TeleportOutW.png); + background-color: #005533; +} + + + + +.grid_td_cpa { + background: url(../images/OverlayA50.png); + /* For non-fancy letters...*/ + /* background: url(../images/OverlayA50ss.png); */ + background-color: #F777FF; + color: #fff; +} +.grid_td_cpb { + background: url(../images/OverlayB50.png); + /* background: url(../images/OverlayB50ss.png); */ + background-color: #FFFF11; + color: #000; +} +.grid_td_cpc { + background: url(../images/OverlayC50.png); + /* background: url(../images/OverlayC50ss.png); */ + background-color: #FF4466; + color: #fff; +} +.grid_td_cpd{ + background: url(../images/OverlayD50.png); + /* background: url(../images/OverlayC50ss.png); */ + background-color: #ff9911; + color: #fff; +} +.grid_td_cpe { + background: url(../images/OverlayE50.png); + /* background: url(../images/OverlayC50ss.png); */ + background-color: #00FFFF; + color: #fff; +} +.grid_td_animate { + /* background: url(../images/OverlayStart50i.png); */ + background: url(../images/OverlayTile50.png); + background-color: #000055; + color: #0000ff; + transition:background-color 2s ease-out; + -webkit-transition:background-color 2s ease-out; + -o-transition:background-color 2s ease-out; + -moz-transition:background-color 2s ease-out; + +} +.grid_td_animate_pre { + /* background: url(../images/OverlayTile50.png); */ + background: url(../images/Path1.png); + background-color: #77ccff; + color: #00ccff; + transition:background-color 0s; + -webkit-transition:background-color 0s; + -o-transition:background-color 0s; + -moz-transition:background-color 0s; +} +.grid_td_path1 , .grid_td_path2, .grid_td_path3, .grid_td_path4 { + transition:background-color .5s ease-out; + -webkit-transition:background-color .5s ease-out; + -o-transition:background-color .5s ease-out; + -moz-transition:background-color .5s ease-out; +} +.grid_td_path1 { + background: url(../images/Path1.png); +} +.grid_td_path2 { + background: url(../images/Path2.png); +} +.grid_td_path3 { + background: url(../images/Path3.png); +} +.grid_td_path4 { + background: url(../images/Path4.png); +} + + +.mapdisplay, .mapdisplay_up +{ + position:absolute; + width:auto; + height:auto; + box-shadow: 10px 10px 5px #000055; /* Opera */ + -webkit-box-shadow: 10px 10px 5px #000055; /* Safari and Chrome */ + + -webkit-transform: + skew(10deg,10deg) + scale(.3, .3) + translate(-390px, -230px) + rotate(1deg) + rotateX(0deg) + ; + -moz-transform: + skew(10deg,10deg) + scale(.3, .3) + translate(-390px, -230px) + rotate(1deg) + rotateX(0deg) + ; + /* Remember, we need to duplicate all of this with prefix -o- and w/o prefix for opera, ff, netscape. */ + -webkit-transition:-webkit-transform 2s; + -webkit-transition-delay: 0s; + -moz-transition:-webkit-transform 2s; + -moz-transition-delay: 0s; + z-index:1; +} +.mapdisplay_up +{ + + -webkit-transform: + skew(0deg,0deg) + scale(1, 1) + translate(0px, 0px) + rotate(0deg) + rotateX(0deg) + ; + -moz-transform: + skew(0deg,0deg) + scale(1, 1) + translate(0px, 0px) + rotate(0deg) + rotateX(0deg) + ; + -webkit-transition:-webkit-transform 1s; + -moz-transition:-webkit-transform 1s; + z-index:2; +} +.mapdisplay_up:hover { + background:#10e; +} +.mapdisplay:hover { + z-index:3; + background:#10e; +} + +.mapgallery +{ + position:relative; + float: left; + width:auto; + height:700px; + background: #110088; + color: #FFF; +} +.mapgallery a +{ + color: #FFFF33; +} + + +.mapcontainer +{ + border:1px solid #000; + position:relative; + float: left; + width:300px; + height:200px; + background: #220099; +} +.clear { clear: both;} diff --git a/css/pagestyle.css b/css/pagestyle.css new file mode 100644 index 0000000..8a834bb --- /dev/null +++ b/css/pagestyle.css @@ -0,0 +1,61 @@ +body { + font-size: 12pt; + font-family: helvetica, sans-serif; + background-color: #121212; + color: #ffffff; + + min-width: 800px; + margin: 0; + padding: 6px; +} + +form { + display: inline; +} + +a:link, a:visited, a:active { + text-decoration: underline; + color: #FFFFCC; + transition:color .4s ease-out; + -webkit-transition:color .4s ease-out; + -o-transition:color .4s ease-out; + -moz-transition:color .4s ease-out; +} +a:hover { + color: #EEDDBB; + text-decoration: none; + transition:color 0s ease-out; + -webkit-transition:color 0s ease-out; + -o-transition:color 0s ease-out; + -moz-transition:color 0s ease-out; +} + +.col1 { + float: left; + width: 25%; + min-width: 300px; + padding: 0 25px; +} +.col2 { + float: left; + width: 50%; + margin: 0 auto; +} + +.float { + float:left; +} +.lfloat { + float:right; +} + +.topbar { + background: #002266; + /* + background: #000044 url(../images/OverlayStart50i.png); + height:35px; + */ + width: 95%; + padding: 5px 15px; + margin: 0 auto; +} diff --git a/css/statsstyle.css b/css/statsstyle.css new file mode 100644 index 0000000..a15636f --- /dev/null +++ b/css/statsstyle.css @@ -0,0 +1,25 @@ +table { + border-collapse: collapse; +} +td, th { + padding: 3px; +} +.lbrow { + background: #000000; + transition:background .5s; + -webkit-transition:background .5s; + -o-transition:color .5s; + -moz-transition:color .5s; + cursor: default; +} +.lbrow:hover { + background: #338899; + transition:background 0s; + -webkit-transition:background 0s; + -o-transition:color 0s; + -moz-transition:color 0s; +} +.hidden-stats { + display: none; +} + diff --git a/do.php b/do.php new file mode 100644 index 0000000..8ff2162 --- /dev/null +++ b/do.php @@ -0,0 +1,255 @@ + 0) { + list($json['solution'], $json['mapid']) = mysql_fetch_row($result); + $encoded = json_encode($json); + die($encoded); + } +} + + + +if ($_GET['r'] == 'getpath') { + + $tmp = GenerateMapByCode($_GET['mapcode']); + $tmp = seperateMapSolution($tmp); + + $mapID = $_GET[mapid] + 0; + $solution = formSolution($_GET['solution'].$tmp); + + //By rule, i try to avoid $var = $_GET as you + // cannot trust $_GET to be non-maliciously inputed data + $mapcode = $_GET['mapcode']; + if ($mapID > 5) { + $mapcode = getMapCode($mapID); + } + + $map = GenerateMapByCode($mapcode); + + $mygrid = MergeMapSolution($map, $solution); + + $json = routePath($mygrid, $start); + + $moves = $json['moves']; + + $topscores = topScores($mapID, 30); + $json['scores'] = $topscores; + + + if ($json['blocked']) { + //$json['error'][] = "blocked"; + $encoded = json_encode($json); + die($encoded); + } + if ($mygrid == -1) { + $json['error'][] = "INVALID WALL POSITIONS"; + $encoded = json_encode($json); + die($encoded); + } + if ($mygrid[0][4] < 0) { + $used = $mygrid[0][4] - $map[0][4]; + $json['error'][] = "Too many walls used. ".$used." of ".$map[0][4]." walls used."; + $encoded = json_encode($json); + die($encoded); + } + + for ($i = 1; $i <= $mygrid[0][1]; $i++) { + $start .= "0,$i."; + } + //$json['path'] = $pathmap1; + + $json['mapid'] = $_GET[mapid]; + + if (!is_int($mapID)) return; + $sql = "SELECT `moves`, `displayName` + FROM `solutions`, `users` + WHERE + `mapID` = '$mapID' AND + `userID` = users.ID + ORDER BY `moves` DESC, `dateModified` ASC + LIMIT 1"; + + $result = mysql_query($sql); + if (mysql_num_rows($result) > 0) { + list($bestMoves, $byName) = mysql_fetch_row($result); + $json['best'] = $bestMoves; + //$json['best'] = 3; + $json['bestby'] = $byName; + } else { + $json['best'] = 0; + $json['bestby'] = 'no one'; + } + + + //If there's a session, and this is a current map. + if ($_SESSION['accepted'] == 1 AND isCurrentMap($mapID)) { + $userID = $_SESSION['userID']; + + $sql = "SELECT * + FROM `maps` + WHERE `ID` = '$mapID' AND `code` = '$mapcode'"; + + $result = mysql_query($sql); + if (mysql_num_rows($result) == 0) { + //$json['error'][] = "Error, mapID and code do not match."; + $encoded = json_encode($json); + die($encoded); + } + + //Personal best + $sql = "SELECT `moves` + FROM `solutions` + WHERE `userID` = '$userID' AND + `mapID` = '$mapID' + "; + $result = mysql_query($sql); + if (mysql_num_rows($result) > 0) { + list($myMoves) = mysql_fetch_row($result); + $json['mybest'] = $myMoves; + } + + + + //$result = mysql_query($sql); + //while (list($ListID, $modified) = mysql_fetch_row($result)) { + // $_SESSION['listsstate'][$ListID] = "$ListID$modified"; + // } + $sql = "SELECT `moves` + FROM `solutions` + WHERE `userID` = '$userID' + AND `mapID` = $mapID;"; + + $result = mysql_query($sql); + if (mysql_num_rows($result) > 0) { + list($reqMoves) = mysql_fetch_row($result); + if ($reqMoves < $moves) { + $sql = "UPDATE `solutions` + SET `moves` = '$moves' , + `dateModified` = NOW() , + `solution` = '$solution' + WHERE `userID` = '$userID' AND + `mapID` = '$mapID' + "; + mysql_query($sql); + } + } else { + //Store solution. + $sql = "INSERT INTO `solutions` (`userID`, `mapID`, `solution`, `moves`) + VALUES ('$userID', '$mapID', '$solution', '$moves') + "; + mysql_query($sql); + } + //==This still leaves a lot of solutions... + $sql = "DELETE FROM `solutions` WHERE + `userID` = '$userID' AND + `mapID` = '$mapID' AND + `moves` < '$moves' "; + //mysql_query($sql); + } + + $json['mapid'] = $_GET[mapid]; + + //$json[error][] = "Start value: $start"; + //$json['start'] = "hello jack"; + //$json['map'] = DisplayMap($mygrid); + $encoded = json_encode($json); + die($encoded); + //Die is the same as: + //echo + exit +} + + +function isCurrentMap($mapID) { + include_once('./includes/db.inc.php'); + $sql = "SELECT `ID` FROM `mapOfTheDay` + WHERE `mapDate` = CURDATE() AND + `mapID` = '$mapID' + "; + $result = mysql_query($sql) or die(mysql_error()); + if (mysql_num_rows($result) == 0) + return false; + else + return true; +} + + + + + + + +//Very simple, confirm that all targets are reachable. +Function ValidateMap($mygrid) { + $start = "0,1."; + $target[] = 'a'; + $target[] = 'b'; + $target[] = 'c'; + $target[] = 'f'; + $blocked = false; + foreach($target as $t) { + $p = Findpath ($mygrid, $start, $t); + if ($p['blocked']) return false; + } + return true; +} + + + +$json['error'][] = 'Division by 912 trillion!'; +$json['error'][] = 'Cant count that high.'; + +$json['error'][] = "I forgot what I was doing!"; +$json['error'][] = "Lost track of time, and gaveup!"; + +$encoded = json_encode($json); +die($encoded); + + + +?> \ No newline at end of file diff --git a/errors.php b/errors.php new file mode 100644 index 0000000..05a717a --- /dev/null +++ b/errors.php @@ -0,0 +1,15 @@ +$_SERVER[HTTP_REFERER]"; + +Echo "
Go back to Home"; + + + +?> \ No newline at end of file diff --git a/globe.php b/globe.php new file mode 100644 index 0000000..72795c8 --- /dev/null +++ b/globe.php @@ -0,0 +1,157 @@ + +
+
+
+
+
+
+ + +
+
$message +
You are now being redirected. +
Click here if not redirected in $duration seconds. +
+
+
+ + +"; + +} + + +?> diff --git a/images/Old Images/GameIdea.bmp b/images/Old Images/GameIdea.bmp new file mode 100644 index 0000000..18b7da1 Binary files /dev/null and b/images/Old Images/GameIdea.bmp differ diff --git a/images/Old Images/GameIdea.jpg b/images/Old Images/GameIdea.jpg new file mode 100644 index 0000000..940c68e Binary files /dev/null and b/images/Old Images/GameIdea.jpg differ diff --git a/images/Old Images/mazetd graphics.jpg b/images/Old Images/mazetd graphics.jpg new file mode 100644 index 0000000..8f5ab2a Binary files /dev/null and b/images/Old Images/mazetd graphics.jpg differ diff --git a/images/Old Tiles/OverlayA50.png b/images/Old Tiles/OverlayA50.png new file mode 100644 index 0000000..51bb005 Binary files /dev/null and b/images/Old Tiles/OverlayA50.png differ diff --git a/images/Old Tiles/OverlayB50.png b/images/Old Tiles/OverlayB50.png new file mode 100644 index 0000000..e382b7d Binary files /dev/null and b/images/Old Tiles/OverlayB50.png differ diff --git a/images/Old Tiles/OverlayC50.png b/images/Old Tiles/OverlayC50.png new file mode 100644 index 0000000..fc5c02b Binary files /dev/null and b/images/Old Tiles/OverlayC50.png differ diff --git a/images/Old Tiles/OverlayD50.png b/images/Old Tiles/OverlayD50.png new file mode 100644 index 0000000..f72f141 Binary files /dev/null and b/images/Old Tiles/OverlayD50.png differ diff --git a/images/Old Tiles/OverlayE50.png b/images/Old Tiles/OverlayE50.png new file mode 100644 index 0000000..5d55f5d Binary files /dev/null and b/images/Old Tiles/OverlayE50.png differ diff --git a/images/Old Tiles/TeleportInAni.gif b/images/Old Tiles/TeleportInAni.gif new file mode 100644 index 0000000..c44444c Binary files /dev/null and b/images/Old Tiles/TeleportInAni.gif differ diff --git a/images/Old Tiles/TeleportInAniOld.gif b/images/Old Tiles/TeleportInAniOld.gif new file mode 100644 index 0000000..007ea3b Binary files /dev/null and b/images/Old Tiles/TeleportInAniOld.gif differ diff --git a/images/Old Tiles/TeleportInAnib.gif b/images/Old Tiles/TeleportInAnib.gif new file mode 100644 index 0000000..ec84975 Binary files /dev/null and b/images/Old Tiles/TeleportInAnib.gif differ diff --git a/images/Old Tiles/TeleportOutAni.gif b/images/Old Tiles/TeleportOutAni.gif new file mode 100644 index 0000000..95d3c19 Binary files /dev/null and b/images/Old Tiles/TeleportOutAni.gif differ diff --git a/images/Old Tiles/TeleportOutAniB.gif b/images/Old Tiles/TeleportOutAniB.gif new file mode 100644 index 0000000..481c24d Binary files /dev/null and b/images/Old Tiles/TeleportOutAniB.gif differ diff --git a/images/Old Tiles/TeleportOutAniOld.gif b/images/Old Tiles/TeleportOutAniOld.gif new file mode 100644 index 0000000..816c925 Binary files /dev/null and b/images/Old Tiles/TeleportOutAniOld.gif differ diff --git a/images/OverlayA50.png b/images/OverlayA50.png new file mode 100644 index 0000000..90d4ea2 Binary files /dev/null and b/images/OverlayA50.png differ diff --git a/images/OverlayA50ss.png b/images/OverlayA50ss.png new file mode 100644 index 0000000..bd1015c Binary files /dev/null and b/images/OverlayA50ss.png differ diff --git a/images/OverlayB50.png b/images/OverlayB50.png new file mode 100644 index 0000000..07b0aec Binary files /dev/null and b/images/OverlayB50.png differ diff --git a/images/OverlayB50ss.png b/images/OverlayB50ss.png new file mode 100644 index 0000000..ea5eac5 Binary files /dev/null and b/images/OverlayB50ss.png differ diff --git a/images/OverlayC50.png b/images/OverlayC50.png new file mode 100644 index 0000000..778dcad Binary files /dev/null and b/images/OverlayC50.png differ diff --git a/images/OverlayC50ss.png b/images/OverlayC50ss.png new file mode 100644 index 0000000..b0677ff Binary files /dev/null and b/images/OverlayC50ss.png differ diff --git a/images/OverlayD50.png b/images/OverlayD50.png new file mode 100644 index 0000000..c416225 Binary files /dev/null and b/images/OverlayD50.png differ diff --git a/images/OverlayD50ss.png b/images/OverlayD50ss.png new file mode 100644 index 0000000..349be11 Binary files /dev/null and b/images/OverlayD50ss.png differ diff --git a/images/OverlayE50.png b/images/OverlayE50.png new file mode 100644 index 0000000..845d6b5 Binary files /dev/null and b/images/OverlayE50.png differ diff --git a/images/OverlayE50ss.png b/images/OverlayE50ss.png new file mode 100644 index 0000000..3a0e719 Binary files /dev/null and b/images/OverlayE50ss.png differ diff --git a/images/OverlayStart50.png b/images/OverlayStart50.png new file mode 100644 index 0000000..e6f6854 Binary files /dev/null and b/images/OverlayStart50.png differ diff --git a/images/OverlayStart50i.png b/images/OverlayStart50i.png new file mode 100644 index 0000000..42559e7 Binary files /dev/null and b/images/OverlayStart50i.png differ diff --git a/images/OverlayTeleport.png b/images/OverlayTeleport.png new file mode 100644 index 0000000..cc25107 Binary files /dev/null and b/images/OverlayTeleport.png differ diff --git a/images/OverlayTeleport.xcf b/images/OverlayTeleport.xcf new file mode 100644 index 0000000..0b5dcfb Binary files /dev/null and b/images/OverlayTeleport.xcf differ diff --git a/images/OverlayTile10.png b/images/OverlayTile10.png new file mode 100644 index 0000000..66a750c Binary files /dev/null and b/images/OverlayTile10.png differ diff --git a/images/OverlayTile20.png b/images/OverlayTile20.png new file mode 100644 index 0000000..8a559f8 Binary files /dev/null and b/images/OverlayTile20.png differ diff --git a/images/OverlayTile30.png b/images/OverlayTile30.png new file mode 100644 index 0000000..a7692e1 Binary files /dev/null and b/images/OverlayTile30.png differ diff --git a/images/OverlayTile50.png b/images/OverlayTile50.png new file mode 100644 index 0000000..20b6ed4 Binary files /dev/null and b/images/OverlayTile50.png differ diff --git a/images/OverlayTileFaceted10.png b/images/OverlayTileFaceted10.png new file mode 100644 index 0000000..affa9e0 Binary files /dev/null and b/images/OverlayTileFaceted10.png differ diff --git a/images/OverlayTileFaceted20.png b/images/OverlayTileFaceted20.png new file mode 100644 index 0000000..678db08 Binary files /dev/null and b/images/OverlayTileFaceted20.png differ diff --git a/images/OverlayTileFaceted30.png b/images/OverlayTileFaceted30.png new file mode 100644 index 0000000..e33c086 Binary files /dev/null and b/images/OverlayTileFaceted30.png differ diff --git a/images/OverlayTileFaceted50.png b/images/OverlayTileFaceted50.png new file mode 100644 index 0000000..362c5c5 Binary files /dev/null and b/images/OverlayTileFaceted50.png differ diff --git a/images/OverlayTiles.xcf b/images/OverlayTiles.xcf new file mode 100644 index 0000000..55e8aea Binary files /dev/null and b/images/OverlayTiles.xcf differ diff --git a/images/Path1.png b/images/Path1.png new file mode 100644 index 0000000..65556a3 Binary files /dev/null and b/images/Path1.png differ diff --git a/images/Path2.png b/images/Path2.png new file mode 100644 index 0000000..42559e7 Binary files /dev/null and b/images/Path2.png differ diff --git a/images/Path3.png b/images/Path3.png new file mode 100644 index 0000000..736a123 Binary files /dev/null and b/images/Path3.png differ diff --git a/images/Path4.png b/images/Path4.png new file mode 100644 index 0000000..ef1f17d Binary files /dev/null and b/images/Path4.png differ diff --git a/images/Teleport1.png b/images/Teleport1.png new file mode 100644 index 0000000..fad3912 Binary files /dev/null and b/images/Teleport1.png differ diff --git a/images/Teleport2.png b/images/Teleport2.png new file mode 100644 index 0000000..930efa7 Binary files /dev/null and b/images/Teleport2.png differ diff --git a/images/Teleport3.png b/images/Teleport3.png new file mode 100644 index 0000000..cb92ee6 Binary files /dev/null and b/images/Teleport3.png differ diff --git a/images/Teleport4.png b/images/Teleport4.png new file mode 100644 index 0000000..5165156 Binary files /dev/null and b/images/Teleport4.png differ diff --git a/images/TeleportIn.png b/images/TeleportIn.png new file mode 100644 index 0000000..b424072 Binary files /dev/null and b/images/TeleportIn.png differ diff --git a/images/TeleportInW.png b/images/TeleportInW.png new file mode 100644 index 0000000..ea8bf4f Binary files /dev/null and b/images/TeleportInW.png differ diff --git a/images/TeleportOut.png b/images/TeleportOut.png new file mode 100644 index 0000000..d8c344e Binary files /dev/null and b/images/TeleportOut.png differ diff --git a/images/TeleportOutW.png b/images/TeleportOutW.png new file mode 100644 index 0000000..737c4c4 Binary files /dev/null and b/images/TeleportOutW.png differ diff --git a/includes/datas.php b/includes/datas.php new file mode 100644 index 0000000..0d3d0c5 --- /dev/null +++ b/includes/datas.php @@ -0,0 +1 @@ + 0) { $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; while (list($diff, $display, $moves, $userID) = mysql_fetch_row($result)) { $i++; if ($_SESSION['userID'] == $userID) $output .= ""; else $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; //$output .= "$i. $display with $moves moves. In $diff
"; $output .= ""; } $output .= "
RankNameMovesTime taken
$i$display$moves$diff
"; } return $output; } ?> \ No newline at end of file diff --git a/includes/db.inc.php b/includes/db.inc.php new file mode 100644 index 0000000..8e9bdfb --- /dev/null +++ b/includes/db.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..53c1a82 --- /dev/null +++ b/includes/header.php @@ -0,0 +1,67 @@ + + + + + + + + + Snapems.com Mazegame + + + + + + +'; + + $page = $_GET[page]; + if ($page == '') + $page = 'home'; + $first = true; + foreach ($links as $key => $value) { + if ($first) + $first = false; + else + echo ' | '; + if ($page == $key) + echo "$value"; + else + echo "$value"; + } + + echo "\t
"; + if ($_SESSION['accepted'] == 1) { + echo "Logged in as $_SESSION[displayName].\n"; + echo "Logout"; + if ($_SESSION['displayName'] == 'noname') + echo "Update your name"; + } else + echo "Sign in using Google"; + + echo "\t
"; + echo ""; +} + +?> diff --git a/includes/mapoftheday.php b/includes/mapoftheday.php new file mode 100644 index 0000000..cd646cb --- /dev/null +++ b/includes/mapoftheday.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/includes/maps.php b/includes/maps.php new file mode 100644 index 0000000..acb4c6c --- /dev/null +++ b/includes/maps.php @@ -0,0 +1,743 @@ +"; + for($j = 0; $j < count($mapMatrix[$i]); $j++) + { + //== + $index++; + + $handle = "$idprefix,$i,$j"; + switch($mapMatrix[$i][$j]) + { + case 's': $maptable .= ""; break; + case 'f': $maptable .= ""; break; + + //TP1 + case 't': $maptable .= ""; break; + case 'u': $maptable .= ""; break; + //TP2 + case 'm': $maptable .= ""; break; + case 'n': $maptable .= ""; break; + //TP3 + case 'g': $maptable .= ""; break; + case 'h': $maptable .= ""; break; + //TP4 + case 'i': $maptable .= ""; break; + case 'j': $maptable .= ""; break; + //TP5 + case 'k': $maptable .= ""; break; + case 'l': $maptable .= ""; break; + + case 'a': $maptable .= ""; break; + case 'b': $maptable .= ""; break; + case 'c': $maptable .= ""; break; + case 'd': $maptable .= ""; break; + case 'e': $maptable .= ""; break; + + case 'r': $maptable .= ""; break; //rock + case 'w': $maptable .= ""; break; //wall + //default: $maptable .= "".$index.""; + default: $maptable .= ""; + //default: $maptable .= "".$mapMatrix[$i][$j].""; + } + } + $maptable .= ""; + } + //Prepare mapdata. + $mapdata['height'] = $mapMatrix[0][0]; + $mapdata['width'] = $mapMatrix[0][1]; + $mapdata['points'] = $mapMatrix[0][2]; + $mapdata['rocks'] = $mapMatrix[0][3]; + $mapdata['walls'] = $mapMatrix[0][4]; + $mapdata['teleports'] = $mapMatrix[0][5]; + $mapdata['example'] = $example; + $mapdata['mapid'] = $idprefix; + + $path = routePath($mapMatrix, ''); + $mapdata['code'] = GenerateMapCode($mapMatrix); + + $width = (($j * 35) + 2).'px'; + //$width = (($j * 23) + 2).'px'; + $i -= 1; + $height = (($i * 35)).'px'; + //$height = (($i * 22) + 2).'px'; + + $jsonmap = json_encode($mapdata); + $mapdatadiv .= "'; + + $maptable = " + $maptable +
"; + + + $prefSpeed = $_COOKIE['pref_speed']; + $speedOption['Slow'] = 1; + $speedOption['Med'] = 2; + $speedOption['Fast'] = 3; + $speedOption['Ultra'] = 4; + if (!in_array($prefSpeed, $speedOption)) + $prefSpeed = '2'; + + foreach ($speedOption as $key => $value) { + $rOption .= "