#NeoPeewee Pygame Engine (January 4, 2020)

import pygame

#Import Global Memory
from Scripts import Global

class Transition:
    def __init__(this):
        #Main Variables
        this.state = 0
        this.alarm = 0
        #Class Variables
        this.transitionState = 1
        this.delay = 10

    #Main Control Method
    def Control(this):
        Global.screen.blit(pygame.image.load('Sprites/Game/transition'+str(this.state)+'.png'), (0, 0))
        if this.alarm == 0:
            this.state += this.transitionState
            if this.state == 5:
                this.alarm = this.delay
                this.transitionState = -1
                #Code can be placed here to do something upon mid-transition
            if this.state == 0:
                pass
                #Code can be placed here to do something upon end-transition
        else:
            this.alarm -= 1
