title: 2D collision detection of images with transparent parts ignored
body: <p>So I decided to look up some collision detection but I've been having trouble finding proper information
  regarding 2d collision detection between two images that includes how to properly avoid detecting the transparent
  areas of an image but I did find one post which I got myself attached to but the problem is that I don't
  really understand the post nor do I understand why he does some of those things...</p>
  
  <p>Here's the post in question: <a href="https://stackoverflow.com/posts/336615/revisions">https://stackoverflow.com/posts/336615/revisions</a></p>
  
  <p>So first of all I want to ask if this solution is actually a good one / proper or if I should just look elsewhere. </p>
  
  <p>Secondly I wonder, in his post, he mentions using integer arrays, not 2d arrays either it seems,  to
  set 1 and 0 to decide  whether or not the pixel is transparent or not but I don't really know how I am supposed
  to achieve this. At first I thought it could be achieved by just forming a string of 1 and 0s and convert it to a Long
  but even with a mere image width of 25, the Long, gets... too long... </p>
  
  <p>I also tried this with no luck, since the code does not function with this array: </p>
  
  <pre><code> long[] array = new long[30*30]; // height * width of the image
      int x = 0;
      int y = 0;
  
  for(int i = 0; i&lt;30*30; i++){
      if(image.getRGB(x,y) == 0){
           array[i] = 0;
      }
      else{ array[i] = 1; }
  
      x++;
      if (x==30){
           y++;
           x=0;
      } 
  }
  </code></pre>
  
  <p>Thirdly, I was hoping someone could maybe explain the whole process and why the things he does, are necessary.
  By the way, I do know how those bit wise operators work! 
  In other words, I don't understand his train of thought / motivation for doing the all things in the code and I would like to gain an understanding of all this! </p>
  
  <p>I don't really know how to proceed right now hehe... </p>