@ -44,11 +44,18 @@ def play():
########################## LAYER 0 END
########################## LAYER 1
if slowsurf.switch == True:
slowsurf.place(window)
if slowsurf.collide(player.player_rect):
enemy.vel -= 0.1
enemy2.vel -= 0.1
print("Colliding !")
slowsurf.switch = False
else:
if slowsurf.timer >= 0:
slowsurf.timer -= 1
enemy.vel = 3 - 2
enemy2.vel = 3 - 2
enemy.bul_cooldown += 1.5
enemy2.bul_cooldown += 1.5
enemy.vel = 3
enemy2.vel = 3
@ -21,6 +21,8 @@ class SlowTimeSurf:
self.height = 64
self.color = (0,0,0)
self.rect = pygame.Rect(self.x, self.y, self.width, self.height)
self.switch = True
self.timer = 500
def place(self,window):
pygame.draw.rect(window,self.color,self.rect)
window.blit(timesurf_image,(self.rect[0], self.rect[1]))