import json
import pygame
import settings
from object_list import ObjectsList

interface = 0
playground_width = settings.SCREEN_WIDTH
playground_height = settings.SCREEN_HEIGHT - interface

pygame.init()
screen = pygame.display.set_mode((settings.SCREEN_WIDTH, settings.SCREEN_HEIGHT))
pygame.display.set_caption(settings.TITLE)
icon = pygame.image.load(settings.ICON)
pygame.display.set_icon(icon)

'''sound_explosion = [
    pygame.mixer.Sound("./data/sound/explosion_1.wav"),
    pygame.mixer.Sound("./data/sound/explosion_2.wav"),
    pygame.mixer.Sound("./data/sound/explosion_3.wav")
    ]

sound_enemy_dead = [
    pygame.mixer.Sound("./data/sound/enemy_dead_1.wav"),
    pygame.mixer.Sound("./data/sound/enemy_dead_2.wav"),
    pygame.mixer.Sound("./data/sound/enemy_dead_3.wav")
    ]

sound_player_dead = pygame.mixer.Sound("./data/sound/player_dead.wav"),'''

game_start = False
buttons = []
objects = None
portal = None
stars = None
global_tick = 0
delay_spawn = 3
current_fps = settings.TICK

player_score = 0

with open('data/player.json', 'r') as f:
    player_parameters = json.load(f)

with open('data/enemies.json', 'r') as f:
    enemies_parameters = json.load(f)
    enemies_keys = list(filter(lambda key: key, enemies_parameters.keys()))

with open('data/armament.json', 'r') as f:
    armament_parameters = json.load(f)
    armament_keys = list(filter(lambda key: key, armament_parameters.keys()))
