from settings import SCREEN_HEIGHT, SCREEN_WIDTH
import random
import pygame
from pygame.locals import (
    RLEACCEL,)
class Enemy(pygame.sprite.Sprite):
    def __init__(self):
        super(Enemy, self).__init__()
        self.surf= pygame.image.load("sprites/Enemy_Sprite.png").convert()
        self.surf.set_colorkey((0, 0, 0), RLEACCEL)
        #self.surf = pygame.Surface((24, 10))
        #self.surf.fill((255, 0, 0))
        self.rect = self.surf.get_rect(
            center=(
                random.uniform(SCREEN_WIDTH + 20, SCREEN_WIDTH + 100),
                random.uniform(0, SCREEN_HEIGHT),
            )
        )
        self.speed = random.uniform(4,10)
    
    

    def update(self):
        self.rect.move_ip(-self.speed, 0)
        if self.rect.right < 0:
            self.kill()