Difference between revisions of "Cycle.time"
(Created page with "cycle.time == <br />Syntax == <blockquote><code>cycle.time(oA,vB);</code></blockquote> == <br />Description == he delay (in interpreter cycles) between cel changes...") |
|||
Line 1: | Line 1: | ||
− | cycle.time | + | The '''cycle.time''' command sets the delay time between changes in an object's cel. |
− | + | == Syntax == | |
− | + | cycle.time([[screen object|obj]] oA, [[variable|var]] vB); | |
− | + | == Remarks == | |
− | + | The cycle time of object '''oA''' is set to the value of '''vB'''. | |
− | + | The [[cycle time]] property determines the number of [[interpreter cycles]] that occur between each change in an object's [[cel]]. For example, if cycle time is 1, then a cel change occurs on every cycle; if cycle time is 2, a cel change occurs on every other cycle, and so on. | |
− | + | Setting cycle time to zero will freeze the object's current cel; no further cel changes will occur while cycle time is zero. (This has the same effect as using the '''[[stop.cycling]]''' command.) | |
− | [[ | + | Don't confuse cycle time with [[step time]]. Step time determines how often an object takes a step (moves), and can be set independent of cycle time. |
− | == | + | == Possible Errors == |
− | + | AGI does not check that object number oA is a valid 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 == | |
− | [[ | + | <div class="CodeBlockHeader">Code:</div> |
− | + | <syntaxhighlight lang="agi"> | |
− | [[ | + | cycle.time(o1, 4); [ object o1 changes its cel every fourth cycle |
− | [[Category: | + | [ this could be used to make something appear in slow motion |
+ | </syntaxhighlight> | ||
+ | |||
+ | == Technical Information == | ||
+ | |||
+ | {| border="1" cellpadding="2" | ||
+ | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' | ||
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 76 (0x4C hex) | ||
+ | |} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | '''[[step.time]]'''<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 19:32, 29 March 2019
The cycle.time command sets the delay time between changes in an object's cel.
Syntax
Remarks
The cycle time of object oA is set to the value of vB.
The cycle time property determines the number of interpreter cycles that occur between each change in an object's cel. For example, if cycle time is 1, then a cel change occurs on every cycle; if cycle time is 2, a cel change occurs on every other cycle, and so on.
Setting cycle time to zero will freeze the object's current cel; no further cel changes will occur while cycle time is zero. (This has the same effect as using the stop.cycling command.)
Don't confuse cycle time with step time. Step time determines how often an object takes a step (moves), and can be set independent of cycle time.
Possible Errors
AGI does not check that object number oA is a valid 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"> cycle.time(o1, 4); [ object o1 changes its cel every fourth cycle
[ this could be used to make something appear in slow motion
</syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 76 (0x4C hex) |