Unit map

Description

Organises the current level into an array together with helper functions

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Record tile  
Record displayTile  

Functions and Procedures

procedure occupy(x, y: smallint);
procedure unoccupy(x, y: smallint);
function isOccupied(checkX, checkY: smallint): boolean;
function withinBounds(x, y: smallint): boolean;
function isWall(x, y: smallint): boolean;
function canMove(checkX, checkY: smallint): boolean;
function canSee(checkX, checkY: smallint): boolean;
function hasPlayer(checkX, checkY: smallint): boolean;
procedure ascendStairs;
procedure descendStairs;
procedure placeAtEntrance;
procedure drawCaveTiles(c, r: smallint; hiDef: byte);
procedure drawDungeonTiles(c, r: smallint; hiDef: byte);
procedure drawCryptTiles(c, r: smallint; hiDef: byte);
procedure drawStoneCavernTiles(c, r: smallint; hiDef: byte);
procedure drawVillageTiles(c, r: smallint; hiDef: byte);
procedure drawTile(c, r: smallint; hiDef: byte);
procedure loadDisplayedMap;
procedure notInView;
procedure setupMap;

Variables

c: smallint;
maparea: array[1..MAXROWS, 1..MAXCOLUMNS] of tile;
mapDisplay: array[1..MAXROWS, 1..MAXCOLUMNS] of displayTile;
mapType: dungeonTerrain;
r: smallint;
startX: smallint;
startY: smallint;

Description

Functions and Procedures

procedure occupy(x, y: smallint);

Occupy tile

procedure unoccupy(x, y: smallint);

Unoccupy tile

function isOccupied(checkX, checkY: smallint): boolean;

Check if a map tile is occupied

function withinBounds(x, y: smallint): boolean;

Check if the coordinates are within the bounds of the gamemap

function isWall(x, y: smallint): boolean;

Check if a tile contains a wall

function canMove(checkX, checkY: smallint): boolean;

Check if the direction to move to is valid

function canSee(checkX, checkY: smallint): boolean;

Check if an object is in players FoV

function hasPlayer(checkX, checkY: smallint): boolean;

Check if player is on a tile

procedure ascendStairs;

Go up stairs

procedure descendStairs;

Go down stairs

procedure placeAtEntrance;

Place the Player on the entrance stair to a dungeon

procedure drawCaveTiles(c, r: smallint; hiDef: byte);

Draw cave tiles

procedure drawDungeonTiles(c, r: smallint; hiDef: byte);

Draw dungeon tiles

procedure drawCryptTiles(c, r: smallint; hiDef: byte);

Draw crypt tile

procedure drawStoneCavernTiles(c, r: smallint; hiDef: byte);

Draw stone cavern tiles

procedure drawVillageTiles(c, r: smallint; hiDef: byte);

Draw village tiles

procedure drawTile(c, r: smallint; hiDef: byte);

Place a tile on the map

procedure loadDisplayedMap;

Display explored sections of map when reloading game

procedure notInView;

Set the whole map to invisible

procedure setupMap;

Setup the current level

Variables

c: smallint;

ROWS and COLUMNS used in loops

maparea: array[1..MAXROWS, 1..MAXCOLUMNS] of tile;

Game map array

mapDisplay: array[1..MAXROWS, 1..MAXCOLUMNS] of displayTile;

The map that the camera uses

mapType: dungeonTerrain;
 
r: smallint;

ROWS and COLUMNS used in loops

startX: smallint;

Player starting position

startY: smallint;

Player starting position


Generated by PasDoc 0.16.0.