# Hey name of this game is ㅤ... :)
# Fullscreen on 1920,1020 in string 6
import os.path

import pygame
import random
B = (0,0,0)
P = (102,0,255)
W = (255,255,255)
game_folder = os.path.dirname(__file__)
img_folder = os.path.join(game_folder, 'img')
player_img = pygame.image.load(os.path.join(img_folder, 'idkfa.png'))
mob1_img = pygame.image.load(os.path.join(img_folder, "mob1.png"))
pygame.transform.scale(player_img, (100,100))



class Player(pygame.sprite.Sprite):
    def __init__(self):
        self.speedx = 0
        pygame.sprite.Sprite.__init__(self)
        self.image = player_img
        self.rect = self.image.get_rect()
        self.rect.center = (WIDTH / 2, HIGHT / 2)
        self.direction = 0
        self.speed = 10
        self.speedx = 0
    def update(self):
        self.speedx = 0
        kbw = pygame.key.get_pressed()
        if kbw[pygame.K_LEFT]:
            self.speedx = -5
        if kbw[pygame.K_UP]:
            self.speedy = -5
        if kbw[pygame.K_DOWN]:
            self.speedy = 5
        if kbw[pygame.K_RIGHT]:
            self.speedx = 5
        self.rect.x += self.speedx
        if self.rect.right > WIDTH:
            self.rect.right = WIDTH
        if self.rect.left < 0:
            self.rect.left = 0
        def shoot(self):
            bullet = Bullet(self.rect.centerx, self.rect.top)
            all_sprites.all(bullet bullet.add (bullet)
            bullet.add(bullet)
        class Bullet(pygame.sprite.Sprite):
    def __init__(self, x, y):
        pygame.sprite.Sprite.__init__(self)
        self.image = pygame.surface((20,0))
        self.image








class Mob1(pygame.sprite.Sprite):
    def __init__(self):
        self.speedx = 0
        pygame.sprite.Sprite.__init__(self)
        self.image = mob1_img
        self.rect = self.image.get_rect()
        self.rect.x = random.randint(0, WIDTH - self.rect.width)
        self.rect.y = random.randint(-50, - 30)
        self.speedy = random.randint(1, 8)
        self.speedx = random.randint(-8, 8)
        self.direction = 0
    def update(self):
        self.rect.x += self.speedx
        self.rect.y += self.speedy
        if self.rect.top > HIGHT or self.rect.left > WIDTH + 30 or self.rect.right < -30:
            self.rect.x = random.randint(0, WIDTH - self.rect.width)
            self.rect.y = random.randint(-50, - 30)
            self.speedy = random.randint(-8, 8)


FPS = 60
WIDTH,HIGHT = 680,480
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WIDTH, HIGHT))
pygame.display.set_caption("pygameㅤwindow")
clock = pygame.time.Clock()

all_sprites = pygame.sprite.Group()
mobs = pygame.sprite.Group()
player = Player()
all_sprites.add(player)
for i in range(0):
    m = Mob1()
    all_sprites.add(m)
    mobs.add(m)


running = True
while running:
    clock.tick(FPS)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    Z = random.randint(000,000)
    X = random.randint(000,000)
    C = random.randint(000,000)

    all_sprites.update()

    screen.fill((Z,X,C))
    all_sprites.draw(screen)
    pygame.display.flip()
pygame.quit()