Question: i create file in public folder and try to include blade file

```
<?php include('../resources/views/template/header.blade.php'); ?>

```

its not working fine, css not render at this point.
Can anyone help me with this

Answer: 
Add an attribute collide to the your "Enemy" class:

```py
class Enemy(pygame.sprite.Sprite):
    def __init__(self, ...):
        # [...]

        self.collide = False

```

Implement the following logic:

* If an enemy collides with the player and `self.collide` is set, do nothing.
* If an enemy collides with the player and `self.collide` is not set, set `self.collide = True` and decrement `life`.
* If an enemy does not collide with the player, set `self.collide = False`.

```py
while run:
    # [...]

    for enemy in enemies:

        if player.rect.colliderect(enemy.rect):

            # If an enemy collides with the player and `self.collide` is set, do nothing.
            if not self.collide:
                # If an enemy collides with the player and `self.collide` is not set, 
                # set `self.collide = True` and decrement `life`.
                self.collide = True
                life -= 1

        else:
            # If an enemy does not collide with the player, set `self.collide = False`.
            self.collide = False

```

This logic means that `live` is only decremented when the enemy hits the player for the first time. The enemy must leave the player's area for a collision to be counted again.
I think the root of your problem is that the while loop loops multiple times while a single "collision" is taking place. In that case, you could consider adding another attribute that allows only one life decrease per collision.

Add an attribute to the enemy class. For this example, lets call it `player_collided`.

Then your collision check could be updated to:

```
while ...:
  ...

  if player.rect.colliderect(enemy.rect) and not enemy.player_collided:
    life -= 1
    enemy.player_collided = True
  else:
    enemy.player_collided = False

```