Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $counterX = 0;
- $counterY = 0;
- $y = $this->startY;
- $x = $this->startX;
- for($height = 0;$height <= $this->displayHeight;$height++) {
- if($counterY %2 == 0) {
- $displayWidth = $this->displayWidth;
- }else {
- $displayWidth = $this->displayWidth-1;
- $this->startY += 1;
- }
- for($width = 0;$width < $displayWidth;$width++) {
- if(empty($this->mapTiles[$x][$y][0])) {
- $tile = 'black';
- }else {
- $tile = $this->mapTiles[$x][$y][0];
- }
- //echo 'X: '.$x.'/Y: '.$y.'<br/>';
- $this->jsonMapTiles[]= $tile;
- $this->mapPositions[] = 'X'.$x.'Y'.$y;
- $y--;
- $x++;
- $counterX++;
- // echo 'Start Y :'.$this->startY.' Counter Y:'.($counterY %2).' Display Width:'.$displayWidth.'<br/>';
- }
- $y = $this->startY;
- $x = $this->startX+1;
- if($counterX % ($this->displayWidth*2-1) == 0) {
- $this->startX += 1;
- }
- $counterY++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement