#NeoPeewee Pygame Engine (January 4, 2020)

#Import Packages
import pygame
from random import randint

from Scripts.Minigames import TemplateClass
from Scripts.Menus import Shop
from Scripts.Menus import Map
from Scripts.Menus import Main
from Scripts.Menus import Inventory
from Scripts.Functions import Graphics
from Scripts.Functions import Audio
from Scripts.Functions import Transition

#ProjectAlchemy Global
def init():
    #Display Screen
    global screen
    screen = pygame.image.load('Sprites/Game/neopeewee.png')

    #Game Set
    global game
    game = TemplateClass.TemplateClass()

    #Shop Set
    global shop
    shop = Shop.Shop()

    #Menu Set
    global map
    map = Map.Map()

    #Main Set
    global main
    main = Main.Main()

    #Inventory Set
    global inventory
    inventory = Inventory.Inventory()

    #Graphics Set
    global graphics
    graphics = Graphics.Graphics()

    #Audio Set
    global audio
    audio = Audio.Audio()

    #Transition Set
    global transition
    transition = Transition.Transition()

#Global Game Methods

#Random Function
def Random(x, y):
    return randint(x, y)

#Text Display Function
def TextDisplay(this, font, colour, x, y, string):
    this.screen.blit(this.graphics.font[font].render(string, 1, colour), (x, y))

#Transition Function
def DoTransition(this, delay):
    this.transition.delay = delay
    this.transition.transitionState = 1
    this.transition.state = 1
