A distinct programming language called Robot Scripting language (RSL) is used to control the actions of the robot. The documentation included with the game is good enough to start writing your own robots (.prg files).
I just created a Dead Target Robot for doing target Practice. The Sample program created using the documentation included with the Robot Battle game defeats Dead Target Robot easily.
Source of Deadtarget.prg:
#The dumbest robot ever. Just sits and waits to get killed. Good for target practice.
Init
{
name( "Dead Target" )
author( "Nagarjun V" )
version( "0.1" )
}
Source of Sample.prg:
# Init section sets up robot and registers handlers
Init
{
name( "Sample" )
lockgun( true )
regcore( MyCore )
regdtcrobot( FoundRobot, 1 )
}
MyCore
{
# if scan finds a robot, the event handler runs
scan( )
radarright( 5 )
}
# scan detected a robot, shoot at it then check again
FoundRobot
{
fire( 1 )
scan( )
}
The results of a game between the above two robots:
Sample | 40 | 20 | 0 |
Dead Target 0.1 | 0 | 0 | 20 |
No comments:
Post a Comment