home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
138.lha
/
Cycle
/
Vertigo.c
< prev
Wrap
C/C++ Source or Header
|
1986-11-20
|
754b
|
35 lines
/* Another simple player. "Vertigo" will try to turn if she is moving
* horizontally, but prefers to continue with her currnet heading if moving
* vertically. In other words, Vertigo prefers the vertical directions.
*/
#include "cycles.h"
char player_name[] = "Vertigo";
strategy_init() {}
strategy_finish() {}
strategy()
{
long x,y,dir;
GetInfo(&x,&y,&dir);
/* (dir & 1) is true for left and right */
if (dir & 1) {
if (!Look(TURN_RIGHT(dir)))
return(TURN_RIGHT(dir));
else if (!Look(TURN_LEFT(dir)))
return(TURN_LEFT(dir));
else
return(dir);
}
else {
if (!Look(dir))
return(dir);
else if (!Look(TURN_RIGHT(dir)))
return(TURN_RIGHT(dir));
else
return(TURN_LEFT(dir));
}
}