A common technique is to layer multiple maps on top of one another, then animate the positions of these layers to produce effects such as parallax scrolling.Īnother use for maps is to design interactive levels or areas of a game world. You can use this along with using the transparent color for pixels in sprites to make regions of transparency in the image. This is more memory efficient than drawing large images in pixels with the sprite editor, and easier to use than storing tables of sprite numbers in code.Īny map cell set to sprite number 0 is not drawn, effectively making that cell transparent. You can use the map to draw large pictures by reusing sprite tiles in multiple cells. You call the map() function to draw a region of the map (a subsection of the grid cells) onto the screen. You can edit the map using the PICO-8 map editor. The map is a grid of sprites from the sprite sheet, where each cell in the grid is assigned a sprite number. Note: mapdraw() is the original name for this function, and may still be found in older carts. Layer If specified, only draw sprites that have flags set for every bit in this value (a bitfield). Sy The y coordinate of the screen to place the upper left corner.Ĭelw The number of map cells wide in the region to draw.Ĭelh The number of map cells tall in the region to draw.
![mapdraw program mapdraw program](https://img.informer.com/screenshots/3755/3755132_1.jpg)
Sx The x coordinate of the screen to place the upper left corner. celx The column location of the map cell in the upper left corner of the region to draw, where 0 is the leftmost column.Ĭely The row location of the map cell in the upper left corner of the region to draw, where 0 is the topmost row. Map( celx, cely, sx, sy, celw, celh, ) Draws a portion of the map to the graphics buffer.