DarwinBotsManual
Open the app EspañolES

.refveldn

The speed at which what you are looking at comes toward you: it is .refvel with the sign flipped.

Facts

Address
698
Name
.refveldn
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: it is .refvel with the sign flipped, positive if what you see is coming closer to you. Also on colliding with a bot. You read it in the next cycle.
Cleared
The engine, every cycle, when the senses are cleared.
Range
−32000 to 32000.
Mutations
picked as a read (*)

.refveldn is exactly .refvel with the sign flipped: positive when what you see is coming toward you, negative when it is moving away. It brings no new information; it exists so that you can write conditions in the sense that feels more natural to you, just as .dn is the opposite of .up.

' something is coming at me fast: I dodge it
cond
*.eye5 0 >
*.refveldn 20 >
start
50 .dx store
stop

If you see nothing, it is 0.