multiple of the tile width. The height of the source image must be an integer multiple of the tile height.
The tiles in the source image will have indices as follows:
The static tiles are indexed like words are read on a page;
1 | 2 | . . . | N | |
|
|
|
| |
N+1 | N + 2 | . . . | 2N | |
|
|
|
| |
2N+1 | 2N + 2 | . . . |
| |
|
|
|
| |
. . . | . . . | . . . | . . . | |
|
|
|
| |
[(M – 1) * | . . . | (M * N ) | ||
N]+1 | ||||
|
|
| ||
|
|
|
|
So the total number of tiles is M * N, where:
−N = (image width) / (tile width);
−M = (image height) / (tile height).
The indices for the static tile set will be
PlayField (int columns, int rows, int cellWidth,
int cellHeight) throws IllegalArgumentException - Creates a new PlayField without a tile set. The parameter are the following:
−columns - width of the PlayField in number of cells;
−rows - height of the PlayField in number of cells;
−cellWidth - Pixel width of each cell;
−cellHeight - Pixel height of each cell.
It creates a new PlayField, rows cells high and columns cells wide. A PlayField created with this constructor will not have any tiles (animated or static) associated with it. The primary use of a PlayField without tiles is expected to be as a container for managing sprites. The