Observe.blocks

From AGI Wiki
Revision as of 17:04, 14 April 2019 by Andrew Korson (talk | contribs) (Created page with "The '''observe.blocks''' command prevents an object from crossing the boundary of a block or a conditional control line. == Syntax == observe.blocks(obj oA...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The observe.blocks command prevents an object from crossing the boundary of a block or a conditional control line.

Syntax

observe.blocks(obj oA);

Remarks

If screen object oA was previously set to ignore blocks (using the ignore.blocks command), the observe.blocks command restores normal behavior.

In addition to observing blocks, this command will also cause objects to observe conditional control lines (pixels with priority of 1 on the priority screen).

Possible Errors

AGI does not check that screen object number oA is a valid screen object. If it is not, this command will overwrite other data on the memory heap, which may cause unexpected results, including possibly crashing AGI.

Example

Code:

<syntaxhighlight lang="agi">block(25, 25, 100, 100); [ create a block ignore.blocks(o1); [ object 1 will ignore the block ... observe.blocks(o1); [ now object 1 will observe the block ... unblock(); [ remove the block </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 89 (0x59 hex)

See Also

block
unblock
ignore.blocks
Managing Obstacles
Control Lines