home *** CD-ROM | disk | FTP | other *** search
- #############################################################################
- # 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
- }
-