Difference between revisions of "Player.control"

From AGI Wiki
Jump to navigationJump to search
(Created page with "player.control   == <br />Syntax == <blockquote><code>player.control();</code></blockquote> == <br />Description == Allows the player to move ego (object 0) around w...")
 
 
Line 1: Line 1:
player.control
+
The '''player.control''' command restores [[player control]] over the [[ego]] [[screen object]].
  
&nbsp;
+
== Syntax ==
  
== <br />Syntax ==
+
player.control();
  
<blockquote><code>player.control();</code></blockquote>
+
== Remarks ==
  
== <br />Description ==
+
By default, [[ego]] ([[screen object]] o0) is controlled by the player via the [[keyboard]], [[joystick]] and/or [[mouse]].
 +
If ego is in program control mode (by executing the '''[[program.control]]''' command, or by using '''[[move.obj]]''', '''[[move.obj.v]]''' or '''[[wander]]''' ), this command restores control back to the player. Ego's direction is not affected when control mode is changed.
  
Allows the player to move ego (object 0) around with the arrow keys, after they have been prevented from doing so by the <code>[[program.control]]</code> command.
+
== Possible Errors ==
  
== <br />Sources ==
+
None.
  
[[AGI Studio Help File]]
+
== Example ==
  
== <br />See also ==
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
program.control();  [ now player cannot control ego
 +
...
 +
player.control();  [ player control is restored
 +
</syntaxhighlight>
  
* <code>[[program.control]]</code>
+
== Technical Information ==
  
&nbsp;
+
{| 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:'''
 +
| 132 (0x84 hex)
 +
|}
  
[[Category:References]]
+
== See Also ==
[[Category:Logic]]
+
 
 +
[[System Commands]]<br />
 +
'''[[program.control]]'''<br />
 +
[[Category:Commands]]<br />

Latest revision as of 07:07, 15 April 2019

The player.control command restores player control over the ego screen object.

Syntax

player.control();

Remarks

By default, ego (screen object o0) is controlled by the player via the keyboard, joystick and/or mouse. If ego is in program control mode (by executing the program.control command, or by using move.obj, move.obj.v or wander ), this command restores control back to the player. Ego's direction is not affected when control mode is changed.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> program.control(); [ now player cannot control ego ... player.control(); [ player control is restored </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 132 (0x84 hex)

See Also

System Commands
program.control