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 --- includes/maps.php | 743 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 743 insertions(+) create mode 100644 includes/maps.php (limited to 'includes/maps.php') 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 .= "