diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-01-08 01:53:05 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-01-08 01:53:05 -0800 |
commit | 6b8c58ac2d4de502421acef48f4434bee605633f (patch) | |
tree | b6ed4553388d0058952a987734a317ecfaea13f9 /pages/gallery.php | |
parent | a431308aa3c6c698d23b45bf5e1f905123e0cba5 (diff) | |
download | pathery-6b8c58ac2d4de502421acef48f4434bee605633f.tar.xz |
Challenges Implementation. LOTS of stuff
Fixed an issue with loading best solution from logged out to logged in state.
Commented out a lot of firephp stuff; feel free to uncomment.
Diffstat (limited to 'pages/gallery.php')
-rw-r--r-- | pages/gallery.php | 178 |
1 files changed, 166 insertions, 12 deletions
diff --git a/pages/gallery.php b/pages/gallery.php index 098cf74..9df059a 100644 --- a/pages/gallery.php +++ b/pages/gallery.php @@ -28,17 +28,171 @@ topbar($Links); include('./includes/maps.php'); include('./includes/mapoftheday.php'); +//$map = getRandomSpecialMap(); +//$map = getRandomWeeklyMap(); +//$map = getRandomComplexMap(); +echo "<br />"; +echo soundManager2(); + + +$spin[] = 'ooooooooooooooo'; +$spin[] = 'oooooororoooooo'; +$spin[] = 'ooooooooooooooo'; +$spin[] = 'uoooroormoroooo'; +$spin[] = 'soooooratooooof'; +$spin[] = 'noooooororooooo'; +$spin[] = 'ooooorooooooooo'; +$spin[] = 'oooooooroororoo'; +$spin[] = 'ooooooooooooooo'; + + +$myparams['checkpoints'] = 3; +$myparams['teleports'] = 1; +$myparams['rockchance'] = 2000; +$myparams['walls'] = 12; +$myparams['name'] = 'Round and Round'; + +$map = GenerateShapedMap($spin, $myparams); + +echo DisplayMap($map, 2); + +//addNewChallengeMap($map, 0, 0, 'Round and Round'); + +//addNewChallenge(1194, "greater than", 163, 1, "Make it go around and around and around"); +//addNewChallenge(1194, "greater than", 161, 1, "Make it go around and around and around", 11); +//addNewChallenge(1194, "greater than", 173, 1, "Make it go around and around and around"); + +exit; + + +//Add's a new custom challenge map - returns mapid +function addNewChallengeMap($map, $tier, $subOrder, $name) { + $mapcode = GenerateMapCode($map); + + $sql = "INSERT INTO `maps` + (`code`, `isChallenge`, `ChallengeTier`, `ChallengeSuborder`, `ChallengeName`) + VALUES + ('$mapcode', true, $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; +} + + +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; +$reversePath[] = 'fo????????????oS'; + +$reversePath = insertPoint($reversePath, 'abc'); + +$myparams['checkpoints'] = 3; +$myparams['teleports'] = 0; +$myparams['rockchance'] = 7; +$myparams['walls'] = 12; +$myparams['name'] = 'Dualing paths'; + +//$map = GenerateShapedMap($reversePath, $myparams); -$openmaps[] = 'Souxoooooooooooooooooooo'; -$openmaps[] = 'ooxoooXooooooooooooooooo'; -$openmaps[] = 'oxooooXoooooooooeocooooo'; -$openmaps[] = 'oxooooXooooooooooooooooo'; -$openmaps[] = 'oxooooXoooaoootooooooooo'; -$openmaps[] = 'oxooooXooooooooooooooooo'; -$openmaps[] = 'oxooooXooooooooooooooooo'; -$openmaps[] = 'oxooooXooooooooooooooooo'; -$openmaps[] = 'oxoooXbdoooooooooooooooo'; -$openmaps[] = 'fooooXooooooooooooooooos'; +$dualingPaths[] = 'so??????????????xf'; +$dualingPaths[] = 'so??????????????xf'; +$dualingPaths[] = 'so??????????????xf'; +$dualingPaths[] = 'so??????????????xf'; +$dualingPaths[] = 'Xo??????????????ox'; +$dualingPaths[] = 'fX??????????????oS'; +$dualingPaths[] = 'fX??????????????oS'; +$dualingPaths[] = 'fX??????????????oS'; +$dualingPaths[] = 'fX??????????????oS'; + +$dualingPaths = insertPoint($dualingPaths, 'abc'); +$dualingPaths = insertPoint($dualingPaths, weight('x', 'xx', 'xxx').weight('X', 'XX', 'XXX')); + +$myparams['checkpoints'] = 3; +$myparams['teleports'] = 0; +$myparams['rockchance'] = 9; +$myparams['walls'] = 12; +$myparams['name'] = 'Dualing paths'; + +$map = GenerateShapedMap($dualingPaths, $myparams); +echo DisplayMap($map, 1); + + + +$unlimited[] = 'so?o?o?o?o?o?o?of'; +$unlimited[] = 's???????????????f'; +$unlimited[] = 'so?????????????of'; +$unlimited[] = 's???????????????f'; +$unlimited[] = 'so?????????????of'; +$unlimited[] = 's???????????????f'; +$unlimited[] = 'so?????????????of'; +$unlimited[] = 's???????????????f'; +$unlimited[] = 'so?o?o?o?o?o?o?of'; + +$unlimited = insertPoint($unlimited, 'abc'); +$unlimited = insertPoint($unlimited, weight('tu', 'dtu')); + +$myparams['checkpoints'] = 3; +$myparams['teleports'] = 1; +$myparams['rockchance'] = 9; +$myparams['walls'] = 999; +$myparams['name'] = 'Unlimited'; + +$map = GenerateShapedMap($unlimited, $myparams); + + +echo "<br />"; +echo soundManager2(); +echo DisplayMap($map, 2); + +htmlfooter(); +exit; + +//$map = GenerateShapedMap($dualingPaths, $myparams); + +//$map = getRandomSpecialMap(); +//$map = getRandomComplexMap(); + + // DUALING PATHS MAP + + + +$openmaps[] = 'SouooooooXoooooooXooooxf'; +$openmaps[] = 'oooooooooXoooooooXooooox'; +$openmaps[] = 'oooooooooxooooooeXcooooo'; +$openmaps[] = 'oooooooooxoooooooXoooooo'; +$openmaps[] = 'oooooooooxaoootooXoooooo'; +$openmaps[] = 'oooooooooxxxxxxxxxoooooo'; +$openmaps[] = 'oooooooooooooooooooooooo'; +$openmaps[] = 'oooooooooooooooooooooooo'; +$openmaps[] = 'Xooooobdoooooooooooooooo'; +$openmaps[] = 'fXooooooooooooooooooooos'; $myparams['checkpoints'] = 5; $myparams['teleports'] = 0; @@ -46,9 +200,9 @@ $myparams['rockchance'] = 15; $myparams['walls'] = 38; $myparams['name'] = 'Dualing Starts'; -$map = GenerateShapedMap($openmaps, $myparams); +//$map = GenerateShapedMap($openmaps, $myparams); -echo DisplayMap($map, 1); +//echo DisplayMap($map, 1); ?> <script src="sounds/script/soundmanager.js"></script> |