Difference between revisions of "Observe.horizon"
(Created page with "The '''observe.horizon''' command prevents an object from going above the horizon. == Syntax == observe.horizon(obj oA); == Remarks == If screen object...") |
m (→Example) |
||
Line 24: | Line 24: | ||
ignore.horizon(o1); [ object 1 is now allowed above horizon | ignore.horizon(o1); [ object 1 is now allowed above horizon | ||
... | ... | ||
− | + | observe.horizon(o1); [ object 1 is NOT allowed above horizon | |
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 06:56, 25 April 2019
The observe.horizon command prevents an object from going above the horizon.
Syntax
observe.horizon(obj oA);
Remarks
If screen object oA was previously set to ignore the horizon (using the ignore.horizon command), the observe.horizon command restores normal behavior.
Use the ignore.horizon command to allow an object to go past the horizon, all the way to the top of the screen.
Use the set.horizon command to adjust the location of the horizon.
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
<syntaxhighlight lang="agi"> set.horizon(42); [ adjust horizon ignore.horizon(o1); [ object 1 is now allowed above horizon ... observe.horizon(o1); [ object 1 is NOT allowed above horizon </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 62 (0x3E hex) |