home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 5
/
ClassicFond05_nopass.iso
/
STRATEGI
/
WINROB.RAR
/
TARGET.PRG
< prev
next >
Wrap
Text File
|
1994-12-03
|
980b
|
30 lines
#############################################################################
# TARGET #
# #
# This robot demonstrates the potential of custom events. This robot sets #
# up a custom event that acts as a trigger. Although this robot only moves #
# when its trigger goes off, a better robot might change its entire #
# behavior. Simply by re-registering some choice sections, such as core, #
# one robot can act like many robots wrapped up in one! #
# #
#############################################################################
Init
{
Name( "Target" )
LockAll( TRUE )
trigger = 80
RegCustom( Move, 1, energy <= trigger )
}
Move
{
BodyLeft( 65 )
Ahead( 100 )
trigger = trigger - 20
}