I only just learned about
bitwise stuff recently myself. Basically,
&& is the AND bitwise operator. Look, here is an example:
collisionFlag: 0101
NXCC_COLLISION_DOWN 0100
When the AND thingy is applied, the first 0 on the top row and the first on the bottom are checked, but since they are both zero, the result is 0. The next ones are both 1, so the result is 1. However, the last ones are 1 and 0, so because they are not the same, the result is 0. It's like using the
and operator in IF statements.
It's a way of combining several different values into one. In this case, they don't actually combine them, they only separate. To combine the values, you use the bitwise OR operator: ||
Example:
hittingdown=2
hittingup=0
hittingside=4
hitting=hittindown||hittingup||hittingside
if hitting&&4 //hittingside=1
//do stuff
endif
Let me know if I got this wrong. I only sort of understand this stuff.
Clonkex