File: move.txt

package info (click to toggle)
colobot 0.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,536 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (22 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\b;Instruction \c;move\n;
The instruction \c;move();\n; instructs the bot to move forward or backward while keeping the same orientation. In brackets you must specify the length of the move in meters.

\b;Basic use
If you want the bot to move forward 30 meters, write \c;move(30);\n;. In order to move the bot backward after it dropped a chunk of \l;titanium ore\u object\titanore; on the \l;converter\u object\convert;, write \c;move(-2.5);\n;.

\b;For specialists
Syntax:
\s;\c;move ( length );\n;

Moves forward or backward of a given distance, always keeping the current orientation of the bot. 

\t;length: \c;\l;float\u cbot\float;\n;
Length of the move, in meters. A negative value makes the bot move backward. 

\t;Return value: \c;\l;int\u cbot\int;\n;
Normally an error stops the program. You can prevent the program from stopping on errors by using the \c;\l;errmode\u cbot\errmode;(0)\n; instruction. A value different from zero if an error occurred is then returned by \c;move()\n;.
\c;== 0 \n;Move executed
\c;!= 0 \n;error, the instruction was not performed correctly

\t;See also
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.