Animation

PixelShiftMulti

function PixelShiftMulti(B: TBoxArray; T: Integer): TIntegerArray;

Calculates how many pixels change in boxes B during time T.

Note

Author: marpis Last Modified: Unknown

Example:

PixelShiftArray := PixelShiftMulti(box, 5000);

PixelShift

function PixelShift(B: TBox; T: Integer): Integer;

Calculates how many pixels change in boxes B during time T.

Note

Author: marpis Last Modified: Nov. 29, 2009

Example:

Result := (PixelShift(box, 5000) > 2000);

AveragePixelShift

function AveragePixelShift(B: TBox; waitPerloop, maxTime: Integer): Integer;

Gets the average pixel shift every ‘waitPerLoop’ ms over the time ‘maxTime’

Note

Author: Coh3n Last Modified: Mar. 31st, 2011

Example:

Result := (AveragePixelShift(box, 500, 5000) > 2000);

ReturnGridColorsInBox

function ReturnGridColorsInBox(Box : TBox): T2DIntegerArray;

Returns a 2D color array from the pixels contained by Box.

Note

Author: m34tcode Last Modified: 4/7/2012

ValidatePixels

procedure ValidatePixels(Box : TBox; OrigCols : T2DIntegerArray; BoolArr : array of TBoolArray; Tolerance : Integer);

Checks for which pixels, in OrigCols, have changed beyond the specified tolerance, since the last check

Note

Author: m34tcode Last Modified: 4/7/2012

InitBoolArr

function InitBoolArr(Width,Height : Integer): array of TBoolArray;

Initializes a 2D boolean array, of dimensions Width x Height to True;

Note

Author: m34tcode Last Modified: 4/7/2012

CountBools

function CountBools(BoolArr : Array of TBoolArray; CountTrues : Boolean) : Integer;

Counts all boolean values in the array, equal to CountTrue

Note

Author: m34tcode Last Modified: 4/7/2012

PixelShiftOT

function PixelShiftOT(Box : TBox; ShiftInterval, Repetitions, Tolerance : Integer) : Integer;
Returns an integer equal to the number of pixels,
within Box, that changed more than tolerance, in the time specified by ShiftInterval * Repetitions

Note

Author: m34tcode Last Modified: 4/7/2012

Example:

PixelCount := PixelShiftOT(IntToBox(10,10,20,20), 500, 4, 10);

AnimatingMulti

function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;

Finds constant animation in boxes B during time T. If PixelShift in box is smaller than MinCount, it’s considered not animating.

Note

Author: marpis Last Modified: Nov. 29, 2009

Example:

boolArray := AnimatingMulti(boxArray, 5000, 2000);
  for i := 0 to High(boolArray) do
  isAnimating := boolArray[i];

Animating

function Animating(B: TBox; Time, MinCount: Integer): Boolean;

Finds constant animation in boxes B during time T. If PixelShift in box is smaller than MinCount, it’s considered not animating.

Note

Author: marpis Last Modified: Nov. 29, 2009

Example:

playerAnimating := Animating(box, 5000, 2000);

IsMoving

function IsMoving: Boolean;

Results true if character is moving.

Note

Author: marpis Last Modified: Nov. 29, 2009

Example:

PlayerMoving := IsMoving;

WaitNotMoving

function WaitNotMoving(WaitFlag: Boolean): Boolean;

Waits until you arent moving, WaitFlag boolean is there because if you clicked in an area that isnt walkable the flag will not disappear. Includes a timeout of 20 seconds for safety.

Note

Author: Ollybest

Example:

if WaitNotMoving(true) then
  writeln('Our player has stopped moving!');