Gets the sprite number assigned to a cell on the map.
- The column (x) coordinate of the cell.
- The row (y) coordinate of the cell.
mget() function returns the sprite number assigned to a cell on the map. If a cell was modified by a call to mset,
mget() returns the updated value.
When using the map to store level designs, a common technique is to keep track of the player's effective cell position on the map, then use
mget() to look for adjacent level features such as obstructions. This can be combined with sprite flags (read with fget()) to indicate which sprite tiles represent obstructions, so a general purpose test for obstructions only needs to read the flags.
to_the_right = mget(player.celx + 1, player.cely)
This function works only when the tiles are drawn by map() function.