From 16567167343024754247818e92115ed83255ed0d Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 8 Jan 2013 22:47:13 -0800 Subject: Map class and Challenges The mapclass should eventually replace the current mapmatrix array w/ headers. Work on challenges progresses nicely --- includes/maps.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'includes/maps.php') diff --git a/includes/maps.php b/includes/maps.php index 1df258d..6a831c8 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -285,6 +285,61 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL) return $output; } + +//This requires the map as an object. +function DisplayMapThumbnail($map, $link = false) { + $r = ''; //Prepare our return value: + + if ($link) + $r .= ""; + else + $r .= "
"; + + for ($y = 0; $y < $map->height; $y++) { //Number of Rows + $r .= ""; + for ($x = 0; $x < $map->width; $x++) { //Number of Columns + $value = $map->tiles[$y][$x][TileValue]; + $type = $map->tiles[$y][$x][TileType]; + switch($type) { + case TileEmpty: + $r .= ""; + //$r .= ""; + break; + case TileCheckpoint: + $r .= ""; + //$r .= ""; + break; + case TileRock: + $r .= ""; + //$r .= ""; + break; + case TileStart: + $r .= ""; + //$r .= ""; + break; + case TileFinish: + $r .= ""; + //$r .= ""; + break; + case TileTeleportIn: + $r .= ""; + //$r .= ""; + break; + case TileTeleportOut: + $r .= ""; + //$r .= ""; + break; + } + } + $r .= ""; + } + $r .= "
"; + + return $r; +} + + + //Generates map function GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1, $mapName = '') { -- cgit v1.2.3