DarwinBotsManual
Open the app EspañolES

.veldn

The bot's backward velocity: it is .velup with its sign flipped.

Facts

Address
199
Name
.veldn
Kind
Sense: the engine writes it for the DNA to read
Group
Movement
Written by
The engine, in the movement phase, after moving and turning the bot: .velup with its sign flipped. You read it in the next cycle.
Cleared
Nobody; the engine rewrites it every cycle.
Range
Between minus and plus .maxvel; positive when reversing.
Mutations
picked as a read (*)

.veldn is exactly .velup with its sign flipped: positive when the bot moves in reverse relative to its heading and negative when it moves forward. It adds no information; it exists so that conditions read more naturally, like “if it is backing up” instead of “if the forward velocity is negative”.

The engine publishes it after moving and turning the bot, and it is 0 in the first cycle.

' if it's going in reverse, thrusts forward to compensate
cond
*.veldn 0 >
start
*.veldn .up store
stop