$value) { $map->$key = $value; } //Store the code in the object $code = $map->getOldCode(); $map->code = $code; echo json_encode($map); exit; } if ($_REQUEST['genMap']) { //function GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1, $mapName = '') { $map = GenerateMap($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['rockChance'], $_REQUEST['wallCount'], $_REQUEST['checkpoints'] % 6, $_REQUEST['teleports'] % 6); //$map = GenerateMap($_REQUEST['height'], $_REQUEST['width'], $_REQUEST['rockChance'], 0, 0, 0); //$map = insertPoint($map, $_REQUEST['points'], 'o'); $code = GenerateMapCode($map); $map = new map($code); echo json_encode($map); exit; } //Add's a new custom challenge map - returns mapid function addNewChallengeMap($map, $tier, $subOrder, $name) { $mapcode = GenerateMapCode($map); $sql = "INSERT INTO `challengeMaps` (`code`, `ChallengeTier`, `ChallengeSuborder`, `Name`) VALUES ('$mapcode', $tier, $subOrder, '$name')"; echo $sql; mysql_query($sql); $mapID = mysql_insert_id(); return $mapID; } //Returns challenge ID function addNewChallenge($mapID, $inequality, $goal, $ordering, $hint, $restrictWallCount = 'null', $restrictWallPlacement = 'null', $restrictTeleportCount = 'null', $restrictTeleportsUsed = 'null', $restrictStartPoint = 'null', $restrictEndPoint = 'null') { $sql = "INSERT INTO `challenges` ( `mapID`, `inequality`, `goal`, `ordering`, `hint`, `restrictWallCount`, `restrictWallPlacement`, `restrictTeleportCount`, `restrictTeleportsUsed`, `restrictStartPoint`, `restrictEndPoint` ) VALUES ( '$mapID', '$inequality', $goal, $ordering, '$hint', '$restrictWallCount', '$restrictWallPlacement', '$restrictTeleportCount', '$restrictTeleportsUsed', '$restrictStartPoint', '$restrictEndPoint' )"; echo $sql; mysql_query($sql); $challengeID = mysql_insert_id(); return $challengeID; } // Start Page: htmlHeader(array('stats', 'mapeditor'), 'Map Editor', 'Map Editor', array('dateformat')); ?>

Map Editor Beta

Load Map:
Load map by ID:
Load map by code:
Generate a random map:
Height:
Width:
Rockchance 1 in:
Checkpoints: (Max 5)
Teleports: (Max 5)
Settings:
Map Name:
Height:
Width:
Walls:
'; continue; } echo "
"; } ?>
Edit Map:
Loading...
Playable Map
MapCode:
Returned map goes here.