Difference between revisions of "Key Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Mike
imported>Repenning
 
Line 1: Line 1:
[[image:Key.png|150px]]
+
[[Image:Key.png|150px|Key.png]]  
  
[[image:Key condition.png|150px]]
+
[[Image:Key condition.png|150px|Key condition.png]]  
  
<table cellpadding="10" cellspacing="0" border="0" width="100%">
+
{| cellpadding="10" cellspacing="0" border="0" width="100%"
<tr>
+
|-
<td align="left" valign="top" width="80"><b>Definition:</b></td>
+
| align="left" valign="top" width="80" | '''Definition:'''
<td align="left" valign="top" width="100%">The <strong>Key</strong> condition checks if the key displayed in its Key parameter is pressed. If the key indicated is pressed, the condition is true. Otherwise, the condition is false. The Key condition can be used to assign real-time keyboard control to agents. You might use it to assign "hot key" values to get agents to act out specified actions when certain keys are pressed. To get Key conditions to function as hot keys you will have to place them in rules in a method that is checked at every simulation cycle.<br>
+
| align="left" valign="top" width="100%" |
''Please note that you cannot use the DELETE key as an argument for the key condition. It is reserved in the AgentCubes software for deleting text, and commands in behaviors.''
+
True if the specified key is pressed on keyboard.
</td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
 
<td align="left" valign="top" width="100%">[[Key parameter|key]]</td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Example:</b></td>
 
<td align="left" valign="top" width="100%">
 
[[Image:Key condition example.png|500px]]</td>
 
</tr>
 
  
</table>
+
 
 +
 
 +
''Please note that you cannot use the DELETE key as an argument for the key condition. It is reserved in the AgentCubes software for deleting text, and commands in behaviors.''
 +
 
 +
|-
 +
| align="left" valign="top" width="80" | '''Parameters:'''
 +
| align="left" valign="top" width="100%" | [[Key parameter|key]]
 +
|-
 +
| align="left" valign="top" width="80" | '''Example:'''
 +
| align="left" valign="top" width="100%" |
 +
Create a cursor controlled agent by using 4 rules:
 +
 
 +
IF '''key(up)''' THEN move(up)
 +
 
 +
IF '''key(down)''' THEN move(down)
 +
 
 +
IF '''key(left)''' THEN move(left)
 +
 
 +
IF '''key(right''') THEN move(right)
 +
 
 +
|}
  
 
[[Category:AgentCubes_Conditions]]
 
[[Category:AgentCubes_Conditions]]

Latest revision as of 03:20, 20 April 2012

Key.png

Key condition.png

Definition:

True if the specified key is pressed on keyboard.


Please note that you cannot use the DELETE key as an argument for the key condition. It is reserved in the AgentCubes software for deleting text, and commands in behaviors.

Parameters: key
Example:

Create a cursor controlled agent by using 4 rules:

IF key(up) THEN move(up)

IF key(down) THEN move(down)

IF key(left) THEN move(left)

IF key(right) THEN move(right)