Commit 0a0fa399 authored by talljosh's avatar talljosh

Fixed glitch when using Pygame 2 which would result in shots not being shown...

Fixed glitch when using Pygame 2 which would result in shots not being shown when fired (almost) exactly horizontally or vertically.
parent 6d66e120682a
......@@ -146,9 +146,11 @@ class ShotSprite(object):
self.drawLines(screen, area, self.colour, points, thickness=6)
def drawLines(self, screen, area, colour, points, thickness):
rect = pygame.Rect(points[0], (0, 0))
rect = pygame.Rect(points[0], (thickness, thickness))
for point in points[1:]:
rect.union_ip(point, (0, 0))
rect.union_ip(point, (thickness, thickness))
rect.left -= thickness // 2
rect.top -= thickness // 2
if not rect.colliderect(area):
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment