|
|
(2 intermediate revisions by one other user not shown) |
Line 1: |
Line 1: |
− | [[Tutorials and Guides|Tutorials and Guides Table of Contents]]<br />
| |
− | [[AGI Command Reference|AGI Command Reference Index]]<br />
| |
| | | |
− | <div align="center">
| |
− | Page:
| |
− | [[AGI Command Reference - Arithmetic Commands|1]] |
| |
− | [[AGI Command Reference - Commands to Load and unLoad Resources|2]] |
| |
− | [[AGI Command Reference - Program Control Commands|3]] |
| |
− | [[AGI Command Reference - Object Control Commands|4]] |
| |
− | [[AGI Command Reference - Object Description Commands|5]] |
| |
− | [[AGI Command Reference - Object Motion Control Commands|6]] |
| |
− | [[AGI Command Reference - Inventory Item Management Commands|7]] |
| |
− | [[AGI Command Reference - PIC Resource Management Commands|8]] |
| |
− | [[AGI Command Reference - Sound Resource Management Commands|9]] |
| |
− | [[AGI Command Reference - Text Management Commands|10]] |
| |
− | [[AGI Command Reference - String Management Commands|11]] |
| |
− | [[AGI Command Reference - Initialization Commands|12]] |
| |
− | [[AGI Command Reference - Menu Management Commands|13]] |
| |
− | [[AGI Command Reference - Test Commands|14]] |
| |
− | [[AGI Command Reference - Other Commands|15]] |
| |
− | [[AGI Command Reference - Unknown Commands|16]]
| |
− | </div><br />
| |
− |
| |
− | <div align="center"><span style="font-size: 22pt">Object Motion Control Commands</span><br />
| |
− | ''By [[Chris Cromer]]''</div>
| |
− |
| |
− |
| |
− |
| |
− | The following commands can be given to the object included in the interpreter control list with animate_obj:
| |
− |
| |
− | == <br />set.horizon(n); ==
| |
− |
| |
− | <blockquote>Set the horizon to y = n.</blockquote>
| |
− |
| |
− | == ignore.horizon(n); ==
| |
− |
| |
− | <blockquote>Object n moves regardless of the horizon position.</blockquote>
| |
− |
| |
− | == observe.horizon(n); ==
| |
− |
| |
− | <blockquote>Object n cannot move above the horizon.</blockquote>
| |
− |
| |
− | == block(x1, y1, x2, y2); ==
| |
− |
| |
− | <blockquote>
| |
− | Sets a rectangular area (block).
| |
− |
| |
− | {|
| |
− | |<pre>
| |
− | (x1, y1)
| |
− | ------------------
| |
− | | |
| |
− | | |
| |
− | | |
| |
− | ------------------
| |
− | (x2, y2)
| |
− | </pre>
| |
− | |}</blockquote>
| |
− |
| |
− | == unblock(); ==
| |
− |
| |
− | <blockquote>Cancels previously set block.</blockquote>
| |
− |
| |
− | == ignore.blocks(n); ==
| |
− |
| |
− | <blockquote>Object n moves ignoring conditional barriers (pixels with priority 1) and a block set with a block command.</blockquote>
| |
− |
| |
− | == observe.blocks(n); ==
| |
− |
| |
− | <blockquote>Object n may not cross conditional barriers or leave the block.</blockquote>
| |
− |
| |
− | == ignore.objs(n); ==
| |
− |
| |
− | <blockquote>Object n moves regardless of positions of other objects.</blockquote>
| |
− |
| |
− | == observe.objs(n); ==
| |
− |
| |
− | <blockquote>Object n treats other objects as obstacles.</blockquote>
| |
− |
| |
− | == player.control(); ==
| |
− |
| |
− | <blockquote>The player is allowed to control EGO (object number 0) using the keyboard or the joystick.</blockquote>
| |
− |
| |
− | == program.control(); ==
| |
− |
| |
− | <blockquote>The player is not allowed to control object 0 (EGO).</blockquote>
| |
− |
| |
− | == stop.motion(n); ==
| |
− |
| |
− | <blockquote>Motion of object n is stopped. If n = 0, program_control is automatically executed.</blockquote>
| |
− |
| |
− | == start.motion(n); ==
| |
− |
| |
− | <blockquote>Motion of object n is started. If n = 0 (EGO), player_control automatically executed.</blockquote>
| |
− |
| |
− | == step.size(n, m); ==
| |
− |
| |
− | <blockquote>Var(n) determines the number of pixels the object n moves each step.</blockquote>
| |
− |
| |
− | == step.time(n, m); ==
| |
− |
| |
− | <blockquote>Var(n) determines the speed of object n motion: delay in the interpreter cycles between consecutive steps. If Var(m) = 1, step occurs on every cycle.</blockquote>
| |
− |
| |
− | == move.obj(n, x, y, s, m); move.obj.v(n, x, y, s, m); ==
| |
− |
| |
− | <blockquote>Object n is told to move to the point x,y (or Var(x), Var(y)) by s pixels every step. When the destination is reached, Flag(m) is set to 1. If n = 0 (EGO), program_control is executed automatically.</blockquote>
| |
− |
| |
− | == follow.ego(n, s, m); ==
| |
− |
| |
− | <blockquote>Object n is told to chase object 0 (EGO) by s pixels every step. When EGO's and the object's coordinates become equal, Flag(m) is set to 1.</blockquote>
| |
− |
| |
− | == wander(n); ==
| |
− |
| |
− | <blockquote>Object n randomly changes the direction of its motion (wanders). If n = 0 (EGO), program_control is issued automatically.</blockquote>
| |
− |
| |
− | == normal.motion(n); ==
| |
− |
| |
− | <blockquote>Special object motion mode is canceled. The object continues to move in the direction it was moving in at the time the command was issued.</blockquote>
| |
− |
| |
− | == set.dir(n, m); ==
| |
− |
| |
− | <blockquote>
| |
− | Object n is told to move in the direction Var(m)
| |
− |
| |
− | {|
| |
− | |<pre>
| |
− | 1
| |
− | 8 | 2
| |
− | \ | /
| |
− | \ | /
| |
− | 7 ------------- 3 0 - stop
| |
− | / | \
| |
− | / | \
| |
− | 6 | 4
| |
− | 5
| |
− | </pre>
| |
− | |}</blockquote>
| |
− |
| |
− | == get.dir(n, m); ==
| |
− |
| |
− | <blockquote>Direction of object n motion is stored in Var(m).</blockquote>
| |
− |
| |
− | == object.on.water(n); ==
| |
− |
| |
− | <blockquote>Object n is allowed to be only in the area where its base line is completely on pixels with priority 3 (water surface).</blockquote>
| |
− |
| |
− | == object.on.land(n); ==
| |
− |
| |
− | <blockquote>Object n is not allowed to touch pixels of water surface (priority 3).</blockquote>
| |
− |
| |
− | == object.on.anything(n); ==
| |
− |
| |
− | <blockquote>Motion restrictions previously set on the object n with commands object_on_water or object_on_land are cancelled.</blockquote>
| |
− |
| |
− | == reposition(n, dx, dy); ==
| |
− |
| |
− | <blockquote>Object n jumps from its current location into the location with coordinates x + Var(dx), y + Var(dy).<br />
| |
− | <br />
| |
− | '''Notes:'''<br />
| |
− | Shouldn't there be reposition and reposition.v?<br />
| |
− | There should be, but they don't exist.</blockquote>
| |
− |
| |
− | == reposition.to(n, x, y); reposition.to.v(n, x, y); ==
| |
− |
| |
− | <blockquote>Similar to the preceding command, but the object is moved to the point x, y (Var(x),Var(y)).</blockquote>
| |
− |
| |
− | == stop.update(n); ==
| |
− |
| |
− | <blockquote>Object n is removed from the list of objects updated by the interpreter on each step. The object stays on the screen unchanged.</blockquote>
| |
− |
| |
− | == start.update(n); ==
| |
− |
| |
− | <blockquote>Object n is redrawn on each interpreter step.</blockquote>
| |
− |
| |
− | == force.update(n); ==
| |
− |
| |
− | <blockquote>Object n is redrawn immediately, without waiting for the end of the interpreter cycle.</blockquote>
| |
− |
| |
− | == distance(n, m, d); ==
| |
− |
| |
− | <blockquote>If both objects n and m are on the screen, then<br />
| |
− | Var(d) = ABS(x(n) - x(m)) + ABS(y(n) - y(m)), otherwise<br />
| |
− | Var(d) = 255.</blockquote>
| |
− |
| |
− |
| |
− |
| |
− | <div align="center">
| |
− | Page:
| |
− | [[AGI Command Reference - Arithmetic Commands|1]] |
| |
− | [[AGI Command Reference - Commands to Load and unLoad Resources|2]] |
| |
− | [[AGI Command Reference - Program Control Commands|3]] |
| |
− | [[AGI Command Reference - Object Control Commands|4]] |
| |
− | [[AGI Command Reference - Object Description Commands|5]] |
| |
− | [[AGI Command Reference - Object Motion Control Commands|6]] |
| |
− | [[AGI Command Reference - Inventory Item Management Commands|7]] |
| |
− | [[AGI Command Reference - PIC Resource Management Commands|8]] |
| |
− | [[AGI Command Reference - Sound Resource Management Commands|9]] |
| |
− | [[AGI Command Reference - Text Management Commands|10]] |
| |
− | [[AGI Command Reference - String Management Commands|11]] |
| |
− | [[AGI Command Reference - Initialization Commands|12]] |
| |
− | [[AGI Command Reference - Menu Management Commands|13]] |
| |
− | [[AGI Command Reference - Test Commands|14]] |
| |
− | [[AGI Command Reference - Other Commands|15]] |
| |
− | [[AGI Command Reference - Unknown Commands|16]]
| |
− | </div><br />
| |
− |
| |
− | [[AGI Tutorials|Tutorials Table of Contents]]<br />
| |
− | [[Tutorials and Guides|Tutorials and Guides Table of Contents]]
| |
− |
| |
− | <span style="float: left">[[AGI Command Reference - Object Description Commands|< Previous: Object Description Commands]]</span><span style="float: right">[[AGI Command Reference - Inventory Item Management Commands|Next: Inventory Item Management Commands >]]</span>
| |
− |
| |
− |
| |
− |
| |
− | [[Category:Logic]]
| |
− | [[Category:Commands]]
| |
− | [[Category:References]]
| |
− | [[Category:Tutorials]]
| |
− | [[Category:Objects]]
| |