{"size": 2003, "ext": "scrbl", "max_stars_repo_path": "scribblings/map-section.scrbl", "max_stars_repo_name": "aowens-21/puzzler", "max_stars_repo_stars_event_min_datetime": "2020-04-23T09:12:25.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-05T22:28:06.000Z", "max_issues_repo_path": "scribblings/map-section.scrbl", "max_issues_repo_name": "aowens-21/puzzler", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scribblings/map-section.scrbl", "max_forks_repo_name": "aowens-21/puzzler", "max_forks_repo_forks_event_min_datetime": "2020-04-27T14:03:51.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-05T21:37:58.000Z"}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 29.4558823529, "max_line_length": 192, "alphanum_fraction": 0.7219171243}
#lang scribble/manual

@title[#:tag "maps"]{Maps}

Every game built with Puzzler will start with a @italic{map section}. This defines the "game world" so to speak, which is represented by
a grid of characters.

@section{Basic Map Rules}

Puzzler maps are made up of blank spaces and entities in the following form:

@verbatim{
 START_MAP
 <map_row>
 ...
 END_MAP
}

Where @italic{<map_row>} is a visual representation of a row on the grid, such as "###" or "#P#". Each @italic{<map_row>} is separated by a new line.
In Puzzler, a "#" character on the map means empty space, and any other character represents an entity in the game. For example:

@verbatim{
 START_MAP
 #####
 ##P##
 #####
 END_MAP
}

The above map is a 5x3 grid with some entity "P" (by convention we make the player "P", but it could be anything) in the center of 2nd row. This
example illustrates an important example about Puzzler maps in that @bold{they do not have to be square}. We could have a 5x3, 5x5, 3x5, or even
a 1x1 (although that wouldn't be very interesting). It is important, however, to note that @bold{all rows must be the same length}. We cannot
do something like the following:

@verbatim{
 START_MAP
 ##P##
 ####
 ###
 END_MAP
}

This would fail to build in Puzzler, as we are currently limited to making all Puzzler maps rectangular.

@section{Multiple Maps}

You can build games in Puzzler which have multiple levels, and the syntax is pretty simple, for example:

@verbatim{
 START_MAP
 P####
 #####
 #####

 #####
 ##P##
 #####

 #####
 #####
 ####P
 END_MAP
}

The above map section generates a Puzzler game with 3 levels which progress in the order that they are defined. While @italic{map_row}s are separated by newlines, maps are separated by a
blank line. Puzzler will continue to look for maps until it sees the @italic{@bold{END_MAP}} token. Games with multiple map definitions have the same rules as games with only one map, however,
it is important to know that @bold{all maps must be the same size}.
