Difference between revisions of "Step.size"
(Created page with "step.size == <br />Syntax == <blockquote><code>step.size(oA,vB);</code></blockquote> == <br />Description == The step size of oA (the number of pixels it moves eac...") |
|||
Line 1: | Line 1: | ||
− | step.size | + | The '''step.size''' command sets the number of pixels that an object moves each step. |
− | + | == Syntax == | |
− | + | step.size([[screen object|obj]] oA, [[variable|var]] vB); | |
− | + | == Remarks == | |
− | + | The [[step size]] of [[screen object]] '''oA''' is set to the value of [[variable]] '''vB'''. The step size of an object determines how far it moves during each step, according to its assigned [[movement mode]]. | |
− | + | Setting the [[step size]] to zero will prevent the object from moving at all. | |
− | + | Do not confuse step size with [[step time]] or [[cycle time]]. Step time determines how often the object takes a step, and cycle time determines how often the object's [[cel]] changes; these parameters can be set independent of step time. | |
− | + | == Possible Errors == | |
− | + | AGI does not check that 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 == | |
− | |||
− | |||
− | |||
− | |||
− | + | <div class="CodeBlockHeader">Code:</div> | |
+ | <syntaxhighlight lang="agi"> | ||
+ | #define giraffe o3 | ||
+ | ... [ initialize the object | ||
+ | step.size(giraffe, 3); [ giraffes have long legs! | ||
+ | </syntaxhighlight> | ||
− | + | == Technical Information == | |
− | [[ | + | |
− | [[ | + | {| border="1" cellpadding="2" |
− | [[Category: | + | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' |
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 79 (0x4F hex) | ||
+ | |} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | '''[[step.time]]'''<br /> | ||
+ | '''[[cycle.time]]'''<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 19:23, 23 April 2019
The step.size command sets the number of pixels that an object moves each step.
Syntax
Remarks
The step size of screen object oA is set to the value of variable vB. The step size of an object determines how far it moves during each step, according to its assigned movement mode.
Setting the step size to zero will prevent the object from moving at all.
Do not confuse step size with step time or cycle time. Step time determines how often the object takes a step, and cycle time determines how often the object's cel changes; these parameters can be set independent of step time.
Possible Errors
AGI does not check that 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">
- define giraffe o3
... [ initialize the object step.size(giraffe, 3); [ giraffes have long legs! </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 79 (0x4F hex) |