<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to robotAPI</title><link>https://sourceforge.net/p/pythonrobocode/wiki/robotAPI/</link><description>Recent changes to robotAPI</description><atom:link href="https://sourceforge.net/p/pythonrobocode/wiki/robotAPI/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 14 Mar 2012 22:14:25 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pythonrobocode/wiki/robotAPI/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage robotAPI modified by Neil Morrison</title><link>https://sourceforge.net/p/pythonrobocode/wiki/robotAPI/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,38 +1,68 @@
 Robots can implement the following functions:
 
-**your robot must import gamefile, this allows it to interface with the arena and the other robots**
-
-
-::: python
+~~~~~~~~~~~~~
+:::python
 import gamefile
-
-&lt;b&gt;def&lt;b colour():
-*    return (0,0,0)*
-
+~~~~~~~~~~~~~
+
+**Your robot must import gamefile, this allows it to interface with the arena and the other robots**
+
+~~~~~~~~~~~~~
+:::python
+def colour():
+    return(0,0,0)
+~~~~~~~~~~~~~
+
+**The colour() function returns an RGB tuple of the form (R,G,B) where R,G and B are numbers between 0 and 255. The editor has a function built in to the robot menu which allows you to change the colour**
+
+~~~~~~~~~~~~~
+:::python
 def commands():
     gamefile.turn_right(deg)
-    turn_left(deg)
-    move(distance in frames/pixels)
-    stop(frames)
-
-def target_spotted(deg):
-    point_gun(deg)
-    fire()
-
-on_hit():
-		
-~~~~~~~~~
-
-
-    :::python
-    # Code goes here ...
-    # def colour():
-    #     return(0,0,0)
-    #
-    # def commands():
-    #     gamefile.turn_right(deg)
-    #     gamefile.turnleft(deg)
-    #     gamefile.move(frames)
-    #     gamefile.stop(frames)
-    #     gamefile.done()
-    #
+    gamefile.turnleft(deg)
+    gamefile.move(frames)
+    gamefile.stop(frames)
+    gamefile.fire()
+    gamefile.done()
+~~~~~~~~~~~~~
+
+**The commands() function interacts with gamefile and allows the robot to move, turn, fire and stop**
+
+**"frames" denotes how many frames the movement will last for, for example gamefile.stop(5) would be stopping for a very sort period and gamefile.move(400) would me a very long movement**
+**if a turn function is called immediately after a stop function, the robot will stop before turning, otherwise the robot will turn while moving.**
+
+**for loops can be used inside the commands function.**
+
+** if statements are also supported, however there may be problems if they rely on values that could change midway through the commands() function's execution, for example a global variable that is changed by target_spotted.**
+
+~~~~~~~~~~~~~
+:::python
+    health = gamefile.robotHealth()
+~~~~~~~~~~~~~
+
+**this optional function will, when called within the commands function return the health of the robot, this can be very useful for changing behaviour under different conditions**
+
+
+~~~~~~~~~~~~~
+:::python
+def target_spotted(direction):
+    gamefile.pointgun(direction)
+    gamefile.fire()
+~~~~~~~~~~~~~
+
+**this function will be called whenever the robot's radar spots another robot, it will return the value direction which you then have to handle, it is recommended to use the gamefile.pointgun(deg) function to tell the robot to turn its gun towards the newly spotted enemy. Then gamefile.fire() will cause the robot to shoot a shell at the target**
+
+~~~~~~~~~~~~~
+:::python
+def startDirection():
+        return deg
+~~~~~~~~~~~~~
+
+**This optional function allows you to define the starting direction you wish your robot to be pointing in when the arena is set up**
+
+
+if any questions about how to use the software remain, feel free to look at the robots already built to see what functions they use.
+
+
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Neil Morrison</dc:creator><pubDate>Wed, 14 Mar 2012 22:14:25 -0000</pubDate><guid>https://sourceforge.netaf08cc3cb81ca61a2a9fd73205d61f32a2cd9770</guid></item><item><title>WikiPage robotAPI modified by Neil Morrison</title><link>https://sourceforge.net/p/pythonrobocode/wiki/robotAPI/</link><description>Robots can implement the following functions:

**your robot must import gamefile, this allows it to interface with the arena and the other robots**


::: python
import gamefile

&lt;b&gt;def&lt;b colour():
*    return (0,0,0)*

def commands():
    gamefile.turn_right(deg)
    turn_left(deg)
    move(distance in frames/pixels)
    stop(frames)

def target_spotted(deg):
    point_gun(deg)
    fire()

on_hit():
		
~~~~~~~~~


    :::python
    # Code goes here ...
    # def colour():
    #     return(0,0,0)
    #
    # def commands():
    #     gamefile.turn_right(deg)
    #     gamefile.turnleft(deg)
    #     gamefile.move(frames)
    #     gamefile.stop(frames)
    #     gamefile.done()
    #
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Neil Morrison</dc:creator><pubDate>Wed, 14 Mar 2012 21:41:57 -0000</pubDate><guid>https://sourceforge.netedd9b89266bee369e5a03820b0d92b51137fdbde</guid></item></channel></rss>