home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 51
/
PCGamer51_17Demos.iso
/
games
/
colobotdemo
/
colobotdemo10e.exe
/
script
/
tower1.txt
< prev
next >
Wrap
Text File
|
2001-06-16
|
872b
|
32 lines
extern void object::ServiceTower1()
{
object tower; // info. about tower
object station; // info. about station
// 1) goes toward the defense tower
tower = radar(DefenseTower); // looks for tower
goto(tower.position); // goes there
while ( true ) // always repeats:
{
// 2) waits until power cell is empty
while ( tower.energyCell.energyLevel > 0.2 )
{
wait(2);
}
grab(); // grabs the power cell
// 3) goes toward power station to recharge
station = radar(PowerStation);
goto(station.position); // goes there
while ( load.energyLevel < 1 )
{
wait(1); // waits until recharged
}
// 4) goes back to defense tower
goto(tower.position); // goes toward tower
drop(); // drops the power cell
}
}