File: 3_Recharge2.txt

package info (click to toggle)
colobot 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,532 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (27 lines) | stat: -rw-r--r-- 1,191 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
24
25
26
27
\b;Programs dispatched by Houston
We have improved the recharge program. When it arrives at the \l;power station\u object\station;, the bot does not wait exactly 5 seconds, but only until the \l;power cell\u object\power; is fully charged. After the bot is back at the initial position, it displays a message on the screen.
\c;
\s;extern void object::Recharge2()
\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;	
\s;	\l;while\u cbot\while; ( \l;energyCell.energyLevel\u cbot\object; < 1 )
\s;	{
\s;		\l;wait\u cbot\wait;(1);           // wait until recharged
\s;	}
\s;	
\s;	\l;goto\u cbot\goto;(start);           // go back to initial pos.
\s;	\l;message\u cbot\message;("Recharge completed");
\s;}
\n;
\b;Archives
Index of the programs dispatched in former missions:

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