File: 2_Recharge1.txt

package info (click to toggle)
colobot 0.2.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,560 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (23 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\b;Programs dispatched by Houston
Below is a program that has been developed by our engineers. It allows you to recharge the \l;power cell\u object\power; of a bot: it goes to the closest \l;power station\u object\station;, waits 5 seconds, and comes back to the initial position.

Remark: If you click on an element of the program underlined in blue, your SatCom will display a text that explains this element. The texts that follow a double slash \c;//\n; are not part of the program, but are comments that help you to understand the program.
\c;
\s;extern void object::Recharge1()
\s;{
\s;	\l;point\u cbot\type;  start;          // variable for initial pos.
\s;	\l;object\u cbot\type; item;           // info. about power station
\s;	
\s;	start = position;      // store initial position
\s;	
\s;	item = \l;radar\u cbot\radar;(\l;PowerStation\u cbot\category;); // look for station
\s;	\l;goto\u cbot\goto;(item.position);   // go to the power station
\s;	\l;wait\u cbot\wait;(5);               // wait 5 seconds
\s;	
\s;	\l;goto\u cbot\goto;(start);           // go back to initial pos.
\s;}
\n;
\b;Archives
Index of the programs dispatched in former missions:

o  \c;\l;SwitchCell1\u programs/1_SwitchCell1;\n;