Maps

 

Maps are created from the Layer Control Box.  When a new map is created, you’ll be asked to define the dimensions of the map in screens.  The size limit is 40*40 screens.

 

In BPaint, maps are arrangements of “tiles”.  The tiles that are used to create BPaint maps are taken straight from the Animations that are currently loaded.

Because all frames within a single Animation must be the same size, being able to use multiple Animations in a single map allows you to use different sized tiles.

 

When you are editing a map, the Image Toolbox is replaced with the Map Toolbox, the Image Palette is replaced with the Map Palette and the Brush view Box is replaced with an Information box.

 

In the map display, the boundaries of each “screen” of the map are displayed in green.  At the top left of each division are displayed details of that division’s position and contents.

 

To place a tile on a map, simply select the one you want from the Map Palette, and click on the screen.  If the Map Grid is activated, the tile will appear on the grid position closest to the mouse pointer.

 

BPaint can save maps in two ways:

 

1.    Irregular maps

 

This will save the map as a list of “cells”. 

Each cell holds a list of tiles.  For each tile four numbers are saved:  Their Image number, their Strip number, their X position and their Y position.

 

There are 2 advantages to saving a map this way:

 

Firstly, tiles need not be arranged in a grid fashion.

 

Secondly, because the map is divided into cells, you need not consider every single tile when your map is being displayed.  All that’s required is a simple check to decide if a cell is visible.  If it is, then its contents can be drawn.

 

There’s an example of how to load and display Irregular maps, along with details of the file structure in the Examples drawer.

 

 

2.    Regular maps

 

This will save the map as simple list of tiles.

For each tile, two values are saved.  Their Strip number and their Image number.

 

When this option used to save a map, only those tiles that lie on grid positions are saved.  This allows you to save “block” style maps, which have advantages in certain circumstances, and make particular types of collision detection easier.

 

When you save a map as a regular map, you will be given advice on the number of discarded and overwritten tiles.

 

Discarded tiles are those that you have placed on the map, but do not lie on grid positions.  Overwritten tiles are those that do lie on grid positions, but have another tile in the exact same position placed on top of them, only one tile will be saved for every grid position.

 

There’s an example of how to load and display Regular maps, along with details of the file structure in the Examples drawer.

 

 

Once a map has been saved as either a Regular or an Irregular map, it must be loaded as the same.

 

Because maps appear as Layers in BPaint, more than one can be displayed at a time.

In the Layer Control Box, when a map is selected, you’ll be given the option to toggle it’s “scroll lock” status.  If the scroll lock is switched on, then that map will be moved whenever the “collective scroll” button in the Map Toolbox is used.  This allows you to display and move multiple maps together, which is pretty handy if you need to make multiple-layer scenery.

 

When loading a map, you’ll be given the option to “add” any map to the current map.  Selecting this will place a copy of the loaded map into the current map at the position of the map display.  If the Map Grid Lock it switched on, then it’ll start at the grid position into which the top left of the display falls.

 

Contents