Compare commits
1 Commits
spencer-mathtime
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d65c6aa6af |
@@ -136,6 +136,13 @@ class Enemy:
|
||||
if self.vx < 0:
|
||||
frame = pygame.transform.flip(frame, True, False)
|
||||
dest = camera.apply(frame.get_rect(topleft=(round(self.x), round(self.y))))
|
||||
if self.behavior == "spider":
|
||||
strand_x = round(self.x + frame.get_width() / 2)
|
||||
start = camera.apply(pygame.Rect(strand_x, round(self.home_y), 1, 1)).topleft
|
||||
end = camera.apply(pygame.Rect(strand_x, round(self.y + 2), 1, 1)).topleft
|
||||
for y in range(start[1], end[1], 3):
|
||||
color = (154, 109, 62) if (y // 3) % 2 == 0 else (104, 70, 42)
|
||||
pygame.draw.line(surface, color, (start[0], y), (end[0], min(y + 2, end[1])))
|
||||
surface.blit(frame, dest)
|
||||
if self.show_health > 0 and self.max_hp > 0 and self.hp < self.max_hp:
|
||||
width = max(10, frame.get_width())
|
||||
|
||||
Reference in New Issue
Block a user