$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; } htmlHeader(array('stats', 'mapeditor'), 'Map Editor', 'Map Editor', array('dateformat')); ?>