Difference between revisions of "Moving Objects"

From AGI Wiki
Jump to navigationJump to search
(Created page with "Each object on screen has a direction it is moving in. This is a numerical value from 0 to 8. <blockquote>File:MovingObjects.png</blockquote> When an object is moving no...")
 
Line 9: Line 9:
 
There are several commands which will make an object move in different ways:
 
There are several commands which will make an object move in different ways:
  
* <code>[[move.obj/move.obj.v]]</code>
+
* <code>[[move.obj]]/[[move.obj.v]]</code>
 
* <code>[[wander]]</code>
 
* <code>[[wander]]</code>
 
* <code>[[follow.ego]]</code>
 
* <code>[[follow.ego]]</code>

Revision as of 19:52, 6 February 2022

Each object on screen has a direction it is moving in. This is a numerical value from 0 to 8.

MovingObjects.png

When an object is moving normally (and has a direction greater than 0), it will continue moving until it is told to stop, move in another direction, or runs into an obstacle (such as a control line, a block, or another object).

An object’s direction can be changed using the set.dir command. The get.dir command will allow you to find out what it’s current direction is. The direction of ego (object 0) is always stored in v6. To stop an object’s movement, use stop.motion.

There are several commands which will make an object move in different ways:

The normal.motion command will make the object in move in the way described above after it has been moving from one of these three commands.

An object’s step size (the number of pixels moved each step) and step time (the number of interpreter cycles between steps) can be set with the step.size and step.time commands.


Sources

AGI Studio Help File


See also