title: Collision between two players
body: <p>I'm making a basic game to amuse my friends. I haven't called it anything yet, but it's basically a square chasing another square. The red square is AI, and the white square is player-controlled. I've got the collision all figured out on that, and it works perfectly.</p>
  
  <p>I decided to make a 2 player version of this game. So I just copied the files over to another folder and transformed it into a 2 player game. Everything works fine, except the collision.
  I have the exact same collision as the singleplayer version, but for some reason, the collision doesn't always work. It's glitchy, and sometimes it only counts if they touched the player's right side, or sometimes it's the left side. There's no determining what happens.</p>
  
  <p>Anyway, here's my death checking code. I call it in the main.lua, in love.update().</p>
  
  <pre><code>death.check=function()
      for _,enemy in ipairs(enemy) do
          for _,player in ipairs(player) do
              if ((enemy.x+enemy.w&gt;player.x and enemy.x+enemy.w&lt;(player.x+player.w)) and
              (enemy.y+enemy.h&gt;player.y and enemy.y+enemy.h&lt;(player.y+player.h))) then
                  death.state=true
              end
          end
      end
  end
  </code></pre>