Unit smell
Classes, Interfaces, Objects and Records
Description
Smell map, a copy of the map is floodfilled with integers. Each integer increments the further away it is from the player. Creatures can then track the player by finding a tile with a lower number than the one that they're standing on.
The below routine is based on code from Stephen Peter (AKA speter)
Uses
Overview
Functions and Procedures
Types
Constants
Variables
Description
Functions and Procedures
function blockORnot(x, y: integer): Tbkinds; |
filename: shortstring; myfile: Text;
|
procedure calcDistances(x, y: smallint); |
Calculate distance from player
|
procedure sniff; |
Generate smell map
|
function scentDirection(y, x: smallint): char; |
Find the tile with the highest scent value
|
function scentDirectionCoords(y, x: smallint): TPoint; |
Get Coordinates of the tile with highest scent value
|
function pathFinding(id: smallint): path; |
Generate a path to the player
|
Types
Constants
BLOCKVALUE = 500; |
used on the smell map to denote a wall
|
Variables
smellCounter: byte; |
Tracks the scent decaying over time
|
Generated by PasDoc 0.16.0.