File: kill1.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 (18 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern void object::KillAnt1()
{
	object item;             // info. about object
	
	goto(-30, 0);            // go west
	aim(0);                  // aim straight
	
	while ( true )           // repeat forever:
	{
		item = radar(AlienAnt, 0, 360, 0, 40);
		if ( item != null )  // ant detected ?
		{
			turn(direction(item.position));
			fire(0.5);       // shoot 0.5 s
		}
		wait(1);             // wait 1 second
	}
}