DarwinBotsManual
Open the app EspañolES

.refypos

The y coordinate of what you are looking at: together with .refxpos and the angle operator, it lets you aim right at it.

Facts

Address
690
Name
.refypos
Kind
Sense: the engine writes it for the DNA to read
Group
What it sees (ref*)
Written by
The engine, in the actions phase of every cycle, with the y published by the bot your focus eye sees; with a shape, a point on it. Also on colliding with a bot. You read it in the next cycle.
Cleared
The engine, every cycle, when the senses are cleared.
Range
0 to 31999, in the same units as .ypos; it grows downward.
Mutations
picked as a read (*)

.refypos is the vertical coordinate of the bot your focus eye sees, in the same units as your own .ypos. As on the screen, it grows downward. It is always used together with .refxpos, which has the full explanation and an example.

Both are also useful for remembering where you saw something. If you save the position in free memory, you can go back and look for it even after you lose sight of it:

' I note where I saw the last prey
cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refxpos 50 store
*.refypos 51 store
stop

Like .refxpos, it brings the position published by the other bot, which can be one cycle late, and it is 0 if you don't see anything.