DarwinBotsManual
Open the app EspañolES

.hitsx

It is 1 in the cycle after a collision on the bot's left side.

Facts

Address
208
Name
.hitsx
Kind
Sense: the engine writes it for the DNA to read
Group
Collisions and hits
Written by
The engine, in the forces and collisions phase: 1 if what it touches is on its left, within the quarter turn centered on that side. You read it in the next cycle.
Cleared
The engine, when the senses are cleared, right after your DNA.
Range
0 or 1.
Mutations
picked as a read (*)

.hitsx turns on when the bot collides with something on its left: the center of the other one falls inside a quarter turn centered on the left side (about 45 degrees to each side), looking from its heading (.aim). It is one of the directions of .hit; its opposite is .hitdx and the other two are .hitup and .hitdn.

Like all touch, the engine writes it in the physics step and your DNA reads it in the next cycle, only once.

To look at what touched it on the left, the bot turns a quarter turn to that side with .aimsx:

cond
*.hitsx 0 !=
start
314 .aimsx store
stop