Darwinbots Forum
Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: PhiNotPi on April 20, 2011, 08:55:44 PM
-
Here is code to find the actual linear distance between the bot and the bot that it is looking at, not the inversely proportionate number given by the focus eye, which depends on the width of the eye (I think). It is based off of the Pythagorean Theorem.
def distance 51
*.refxpos *.xpos sub *.refxpos *.xpos sub mult *.refypos *.ypos sub *.refypos *.ypos sub mult add sqr distance store
-
http://www.darwinbots.com/WikiManual/index.php/Dist (http://www.darwinbots.com/WikiManual/index.php/Dist)
-
lol read the wikik
-
I thought that I had looked all over the wiki for something that told the actual distance. But it is actually a good thing that I now know about the "advanced commands." It makes programming bots a whole lot easier.
If you can't tell, I'm a newbie.
-
Been there done that...
-
Am still
-
BTW Nice sig