Checking if not touching... Read On

  • Diissaster
    19th Apr 2011 Member 0 Permalink
    Why would it?
    What do you need it for?
  • me4502
    19th Apr 2011 Member 0 Permalink
    @Diissaster (View Post)
    The element ant...

    It's supposed to be still unless not touching anything but itself
  • Cr15py
    19th Apr 2011 Member 0 Permalink
    simple if(!(r&0xFF)==PT_CFIR); (r&0xFF) is the element that is touching the particle in question. The ! is the not operator, so if the the element touching the particle is not PT_CFIR then perform the operation.

    EDIT: Oh, not touching any particle but itself. if((r&0xFF)==PT_SELF || !(r&0xFF));
  • me4502
    19th Apr 2011 Member 0 Permalink
    @Cr15py (View Post)
    Thanks. I'll test tomorrow. So I'll just replace self with name of particle and it should work...

    EDIT:::

    i tried this

    if((r&0xFF)==PT_CFIR || !(r&0xFF));
    parts[i].y++;

    what it does is go down when touching any particle..not just ones other than itself