I think we can ask questions about code here. Mine: I'm very bad in C and I can't understand what is >>8 (for example "parts[r>>8].type = PT_SPRK). Can you explain?
>> is a "bitwise" operator, it shifts all the bits 1 bit to the right, in the case of >>8, it shifts them 8 bits to the right. Each particle index is a 32bit integer, though actually 2 unsigned 8bit integers. Say if we have an index that is 1390, represented in binary, this is "00000101 01101110" if we shift all the bits to the right by 8, we get 0000101 or 5, that would be the Particle Type. If we want to get the particle ID, we use the "&" (AND) operator. For example we would do 1390&0xFF (255) to get the first 8 bits, 01101110 or 110.
May I ask another questions? When I try to change particle type into ACID, I get dark-purple liquid which don't act as it. I do so: "parts[r>>8].type = PT_ACID". What I do wrong? And another one: How to delete current particle? "parts[pmap[y][x]>>8].life = 0" don't work.