   Circle to rectangle collisions?  2-D game
  Hey all.I have this situation of wanting lasers to hit the player in my game.  The player's hitbox is a circle.  Lasers would be best represented as a rectangle.  They can be thick lines, hence the rectangle approach.  Lasers could also be going out of something diagonally on-screen, but always in a straight line.So...  is there an easy way to see if said circle overlaps a rectangle of this nature?Also out of curiosity, maybe a parallelogram too?  I'm wondering if I should have that shape for lasers instead...Thanks.   
  You could do 4 circle line intersection tests that way you could do parallelograms as well. To detect a circle line intersection you only have to check the closest point from the circles origin to the line and check if that lies within the circle radius.[Edit] If your rectangles are actually big enough to contain the circle you need to check if the circle origin lies on the 'inside' of each line as well.   