Example #1
0
 def __init__(self, surface, dimensions, debug):
     self.debug = debug
     self.surface = surface
     self.width = dimensions[0]
     self.length = dimensions[1]
     self.boundary = [self.width/2, self.length/2]
     self.focus = (0,0)
     self.mode = 0 #Free camera
     self.colour = (0,0,0)
     self.path = filePath.getRootFolder(FILERETRACTS)
     self.locationFont = pygame.font.Font(filePath.setPath(self.path,["assets","fonts","Kingdom_Hearts_Font.ttf"]), 50)
     self.mainFont = pygame.font.Font(filePath.setPath(self.path,["assets","fonts","Coda-Regular.ttf"]), 30)
Example #2
0
    def __init__(self, dimensions, config, debug=False):
        self.debug = debug
        pygame.mixer.pre_init(44100, -16, 1, 512)
        pygame.init()
        pygame.mouse.set_visible(False)
        self.dimensions = dimensions
        self.surface = pygame.display.set_mode(dimensions)
        pygame.display.set_caption("Kingdom Space Battle")
        
        self.path = filePath.getRootFolder(FILERETRACTS)
        
        self.fontMain = pygame.font.Font(filePath.setPath(self.path,["assets","fonts","Coda-Regular.ttf"]), 24)
        self.fontSub = pygame.font.Font(filePath.setPath(self.path,["assets","fonts","Coda-Regular.ttf"]), 20)

        self.menuSounds = [
            pygame.mixer.Sound(filePath.setPath(self.path,["assets","sounds","system sound effects","error.wav"])),
            pygame.mixer.Sound(filePath.setPath(self.path,["assets","sounds","system sound effects","menu back.wav"])),
            pygame.mixer.Sound(filePath.setPath(self.path,["assets","sounds","system sound effects","menu open.wav"])),
            pygame.mixer.Sound(filePath.setPath(self.path,["assets","sounds","system sound effects","menu scroll.wav"])),
            pygame.mixer.Sound(filePath.setPath(self.path,["assets","sounds","system sound effects","select.wav"])),
        ]

        menuMusic = pygame.mixer.music.load(filePath.setPath(self.path,["assets","sounds","music","Dearly Beloved.wav"]))
        pygame.mixer.music.play(-1)
        
        icon = pygame.image.load(filePath.setPath(self.path,["assets","title screen","icon.png"]))
        pygame.display.set_icon(icon)

        self.emblems = [
            pygame.image.load(filePath.setPath(self.path,["assets","player","emblems","vanguard.png"])),
            pygame.image.load(filePath.setPath(self.path,["assets","player","emblems","engineer.png"])),
            pygame.image.load(filePath.setPath(self.path,["assets","player","emblems","stealth.png"])),
        ]
        
        for i in range(len(self.emblems)): #Scale images
            self.emblems[i] = pygame.transform.scale(self.emblems[i], self.dimensions)
        
        self.controls = {"up":[pygame.K_w], "left":[pygame.K_a], "right":[pygame.K_d], "down":[pygame.K_s],
                         "SQUARE":[pygame.K_j], "CIRCLE":[pygame.K_l,1], "CROSS":[pygame.K_k,0], "TRIANGLE":[pygame.K_i,3],
                         "start":[pygame.K_p,7], "home":[pygame.K_ESCAPE,6],
                         "L1":[pygame.K_q,4], "R1":[pygame.K_e,5]}

        self.playSounds = 1
        self.playMusic = 1
        self.customCursor = 1

        self.startUpAnimation()
        
        self.mainMenu()
Example #3
0
    def open(self, surface, networkProtocol, debug=False):  #Load assets
        self.surface = surface
        self.dimensions = self.surface.get_size()
        self.debug = debug

        self.dt = 16  #milliseconds per frame
        self.waitingTime = self.dt / self.targetDeltaTime

        self.stage = "connecting to server"
        self.clock = 0
        self.closing = False

        self.networkProtocol = networkProtocol
        self.joiningGame = False

        self.controls = {
            "up": [pygame.K_w],
            "left": [pygame.K_a],
            "right": [pygame.K_d],
            "down": [pygame.K_s],
            "SQUARE": [pygame.K_j],
            "CIRCLE": [pygame.K_l, 1],
            "CROSS": [pygame.K_k, 0],
            "TRIANGLE": [pygame.K_i, 3],
            "start": [pygame.K_p, 7],
            "home": [pygame.K_ESCAPE, 6],
            "L1": [pygame.K_q, 4],
            "R1": [pygame.K_e, 5]
        }
        self.entities = {}

        self.path = filePath.getRootFolder(FILERETRACTS)
        self.mainFont = pygame.font.Font(
            filePath.setPath(self.path,
                             ["assets", "fonts", "Coda-Regular.ttf"]), 30)

        self.open = True
Example #4
0
        timeElapsed = pygame.time.get_ticks() - startTime

        wait = max(self.targetDeltaTime - timeElapsed, 0) / 1000
        self.dt = max(self.targetDeltaTime, timeElapsed)
        if self.dt > 16:
            print(self.dt)

        reactor.callLater(wait, self.runClient)

    def setState(self, state, stateName, params=None):
        self.gameState = state(self.targetDeltaTime)
        self.stateName = stateName
        if params != None:
            self.gameState.open(self.surface, params, debug=self.debug)
        else:
            self.gameState.open(self.surface, debug=self.debug)


FILERETRACTS = 2
config = filePath.loadConfig(
    filePath.setPath(filePath.getRootFolder(FILERETRACTS), ["config.txt"]))
SERVER_IP = config["SERVER_IP"]
SERVER_PORT = config["SERVER_PORT"]
RESOLUTION = config["RESOLUTION"]
FPS = config["FPS"]
GRAPHICS = config["GRAPHICS"]
os.environ['SDL_VIDEO_CENTERED'] = '1'
debug = True
gameClient(RESOLUTION, GRAPHICS, debug)
Example #5
0
from lib import filePath

#Loads contents and mods
#Order of priority
#0 base game files
#1-10 Mods
#Any clashes will result in the lower numbered file overwritting the other file
#Clashes between files of the same priority will favour the latter file
#e.g. two mods add in an enemy with the same name, only the enemy from the mod
#with the higher priority will be added in.

#Constants
FILERETRACTS = 2

fileRootPath = filePath.getRootFolder(FILERETRACTS)


#Load enemy data
def loadEnemyData():
    contentFolder = filePath.setPath(fileRootPath,
                                     ["data", "content", "enemies.txt"])
    contentData = filePath.loadConfig(contentFolder)
    return contentData


def loadProjectileData():
    contentFolder = filePath.setPath(fileRootPath,
                                     ["data", "content", "projectiles.txt"])
    contentData = filePath.loadConfig(contentFolder)
    return contentData
    def loadImages(self):
        #PRE-CALCULATIONS
        self.hudMap = (
            (33 * WIDTHSCALE, 603 * LENGTHSCALE), (1065 * WIDTHSCALE,
                                                   10 * LENGTHSCALE)
        )  #Calculated positions of where the hud images are place
        rootFolder = filePath.getRootFolder(2)

        #LOAD HUD TEMPLATE
        self.hud = filePath.setPath(rootFolder,
                                    ["assets", "player", "hud.png"])
        self.hud = pygame.image.load(self.hud).convert_alpha()

        #LOAD ABILITY BOX
        self.abilityBox = (
            (206, 233, 245), (20 * WIDTHSCALE, 595 * LENGTHSCALE,
                              round(320 * WIDTHSCALE),
                              round(110 * LENGTHSCALE)))  #Colour, rect

        #LOAD ABILITY ICONS
        self.abilityIcons = (
            ((52, 106, 129),
             (33 * WIDTHSCALE, 630 * LENGTHSCALE, round(64 * WIDTHSCALE),
              round(64 * LENGTHSCALE))), ((52, 106, 129),
                                          (110 * WIDTHSCALE, 630 * LENGTHSCALE,
                                           round(64 * WIDTHSCALE),
                                           round(64 * LENGTHSCALE))),
            ((52, 106, 129), (187 * WIDTHSCALE, 630 * LENGTHSCALE,
                              round(64 * WIDTHSCALE),
                              round(64 * LENGTHSCALE))),
            ((52, 106, 129),
             (264 * WIDTHSCALE, 630 * LENGTHSCALE, round(64 * WIDTHSCALE),
              round(64 * LENGTHSCALE))))  #(Colour, rect), (Colour, rect), ...

        #LOAD HP BAR
        self.hpBar = (
            ((30, 58, 93), (1112 * WIDTHSCALE, 673 * LENGTHSCALE,
                            round(163 * WIDTHSCALE), round(12 * LENGTHSCALE)),
             round(2 * WIDTHSCALE)),
            ((77, 161, 24), (1112 * WIDTHSCALE, 673 * LENGTHSCALE,
                             round(163 * WIDTHSCALE), round(12 * LENGTHSCALE)))
        )  #Border (Colour, rect), Fill (Colour, rect)

        #LOAD MP BAR
        self.mpBar = (
            ((30, 58, 93), (1154 * WIDTHSCALE, 688 * LENGTHSCALE,
                            round(120 * WIDTHSCALE), round(12 * LENGTHSCALE)),
             round(2 * WIDTHSCALE)), ((47, 105, 203),
                                      (1154 * WIDTHSCALE, 688 * LENGTHSCALE,
                                       round(120 * WIDTHSCALE),
                                       round(12 * LENGTHSCALE)))
        )  #Border (Colour, rect), Fill (Colour, rect)

        #LOAD LEVEL BAR ANIMATION
        self.levelBar = []
        levelBarImage = filePath.setPath(
            rootFolder, ["assets", "player", "level bars.png"])
        levelBarImage = pygame.image.load(levelBarImage).convert()
        for i in range(9):
            levelBar = pygame.Surface((1180, 88))
            levelBar.blit(levelBarImage, (0, 0), (0, i * 88, 1180, 88))
            levelBar = pygame.transform.smoothscale(
                levelBar, (round(295 * WIDTHSCALE), round(22 * LENGTHSCALE)))
            self.levelBar.append(levelBar)

        #LOAD ATTACK STYLE ICON
        self.basicAttacks = [
            filePath.setPath(rootFolder,
                             ["assets", "player", "basic surge.png"]),
            filePath.setPath(rootFolder,
                             ["assets", "player", "basic spray.png"]),
            filePath.setPath(rootFolder,
                             ["assets", "player", "basic hyper.png"])
        ]

        for i in range(3):
            image = pygame.image.load(self.basicAttacks[i]).convert_alpha()
            width, length = image.get_rect()[2], image.get_rect()[3]
            targetLength = round(41 * LENGTHSCALE)
            targetWidth = round(width * 41 * WIDTHSCALE / length)
            image = pygame.transform.smoothscale(image,
                                                 (targetWidth, targetLength))
            position = (1240 * WIDTHSCALE - targetWidth, 620 * LENGTHSCALE)
            self.basicAttacks[i] = (image, position)

        #LOAD MINIMAP
        self.minimap = filePath.setPath(rootFolder,
                                        ["assets", "player", "minimap.png"])
        self.minimap = pygame.image.load(self.minimap).convert_alpha()
        self.minimap = pygame.transform.smoothscale(
            self.minimap, (round(205 * WIDTHSCALE), round(187 * LENGTHSCALE)))

        #SET ANIMATION SETTINGS
        self.animations = [[0, 8, 0, 50]
                           ]  #Current frame, Max frame, time elapsed, duration
import pygame, os, math, json
import socket, _thread
from lib import LIMITobjects, contentLoader, filePath
import collision  #experimental

SERVER_IP = socket.gethostbyname(socket.gethostname())
SERVER_PORT = 8080
os.environ['SDL_VIDEO_CENTERED'] = '1'
config = filePath.loadConfig(
    filePath.setPath(filePath.getRootFolder(2), ["config.txt"]))
RESOLUTION = config["RESOLUTION"]
DEBUG = config["DEBUG"]
WIDTHSCALE, LENGTHSCALE = RESOLUTION[0] / 1280, RESOLUTION[
    1] / 720  #Scale game according to default 1280x720 dimensions

networkPacker = {
    "moveForward": 0,
    "turnLeft": 1,
    "turnRight": 2,
    "primaryFire": 3,
}

networkUnPacker = {
    0: "moveForward",
    1: "turnLeft",
    2: "turnRight",
    3: "primaryFire",
}


class server:
Example #8
0
    def __init__(self, surface, dimensions, controls, config, debug=False):
        if debug:
            print("Game Engine initiating.")

        #Set attributes
        self.SERVER_IP = config["SERVER_IP"]
        self.SERVER_PORT = config["SERVER_PORT"]
        self.debug = debug
        self.surface = surface
        self.dimensions = dimensions
        self.entities = []
        self.projectiles = []
        self.party = []
        self.instance = "map"
        self.baracksAnimation = [0, 0, 0]
        self.pausedInstances = ("paused", "interaction", "baracks")
        self.controls = controls
        self.path = filePath.getRootFolder(FILERETRACTS)
        self.entityGroups = {
            "enemy": ("square", "triangle", "entity"),
            "ally": ("player", ),
            "object": ("location", "npc")
        }
        self.FPS = config["FPS"]
        self.currentFPS = config[
            "FPS"]  # Assume it can initially run at the target FPS
        self.deltaMin = round(1000 / self.FPS)

        self.frameCount = 0
        self.fpsTimer = 0
        self.newFPS = config[
            "FPS"]  # Assume it can initially run at the target FPS

        # Load assets
        self.mainFont = pygame.font.Font(
            filePath.setPath(self.path,
                             ["assets", "fonts", "Coda-Regular.ttf"]), 30)

        # Load required parts of the engine
        self.player = None
        self.selectedCommand = 0
        self.commandMenu = [0]
        self.focus = [0, 0]
        self.freeFocus = [0, 0]  # The focus of the camera in free camera mode
        self.cameraSpeed = 500  # The speed of the free camera in metres per second
        self.cameraMode = 0  #0 = free camera
        self.camera = camera(surface, dimensions, debug)
        self.hud = LIMITinterface.display(surface, dimensions, debug)

        # Start the network socket
        if self.debug:
            self.networkType = "Host"
            self.currentImage = []
        else:
            self.networkType = "Peer"
            self.lastFrame = []
        self.networkSocket = None
        self.connectedAddresses = []
        self.activeAddresses = []
        self.peerInputs = []

        if self.networkType == "Host":
            self.networkSocket = socket.socket(socket.AF_INET,
                                               socket.SOCK_DGRAM)
            self.SERVER_IP = socket.gethostbyname(socket.gethostname())
            self.networkSocket.bind((self.SERVER_IP, self.SERVER_PORT))
            if self.debug:
                print("SERVER OPENED ON", self.SERVER_IP, ":",
                      self.SERVER_PORT)
            _thread.start_new_thread(self.peerGateway, ())
        else:
            self.currentFrame = []
            self.frameSkipped = []
            self.networkSocket = socket.socket(socket.AF_INET,
                                               socket.SOCK_DGRAM)
            self.networkSocket.connect((self.SERVER_IP, self.SERVER_PORT))
            _thread.start_new_thread(self.peerConnection, ())
Example #9
0
    def open(self, surface, debug=False):  #Load assets
        self.surface = surface
        self.dimensions = self.surface.get_size()
        self.debug = debug

        self.dt = 16  #milliseconds per frame
        self.waitingTime = self.dt / self.targetDeltaTime

        pygame.mixer.pre_init(44100, -16, 1, 512)
        pygame.mouse.set_visible(False)

        self.path = filePath.getRootFolder(FILERETRACTS)

        self.fontMain = pygame.font.Font(
            filePath.setPath(self.path,
                             ["assets", "fonts", "Coda-Regular.ttf"]), 24)
        self.fontSub = pygame.font.Font(
            filePath.setPath(self.path,
                             ["assets", "fonts", "Coda-Regular.ttf"]), 20)

        self.menuSounds = [
            pygame.mixer.Sound(
                filePath.setPath(
                    self.path,
                    ["assets", "sounds", "system sound effects", "error.wav"
                     ])),
            pygame.mixer.Sound(
                filePath.setPath(self.path, [
                    "assets", "sounds", "system sound effects", "menu back.wav"
                ])),
            pygame.mixer.Sound(
                filePath.setPath(self.path, [
                    "assets", "sounds", "system sound effects", "menu open.wav"
                ])),
            pygame.mixer.Sound(
                filePath.setPath(self.path, [
                    "assets", "sounds", "system sound effects",
                    "menu scroll.wav"
                ])),
            pygame.mixer.Sound(
                filePath.setPath(
                    self.path,
                    ["assets", "sounds", "system sound effects", "select.wav"
                     ])),
        ]

        menuMusic = pygame.mixer.music.load(
            filePath.setPath(
                self.path,
                ["assets", "sounds", "music", "kh3-Dearly Beloved.mp3"]))

        self.musicStarted = False

        self.emblems = [
            pygame.image.load(
                filePath.setPath(
                    self.path, ["assets", "player", "emblems", "vanguard.png"
                                ])).convert_alpha(),
            pygame.image.load(
                filePath.setPath(
                    self.path, ["assets", "player", "emblems", "engineer.png"
                                ])).convert_alpha(),
            pygame.image.load(
                filePath.setPath(
                    self.path, ["assets", "player", "emblems", "stealth.png"
                                ])).convert_alpha(),
        ]

        for i in range(len(self.emblems)):  #Scale images
            self.emblems[i] = pygame.transform.scale(self.emblems[i],
                                                     self.dimensions)

        self.controls = {
            "up": [pygame.K_w],
            "left": [pygame.K_a],
            "right": [pygame.K_d],
            "down": [pygame.K_s],
            "SQUARE": [pygame.K_j],
            "CIRCLE": [pygame.K_l, 1],
            "CROSS": [pygame.K_k, 0],
            "TRIANGLE": [pygame.K_i, 3],
            "start": [pygame.K_p, 7],
            "home": [pygame.K_ESCAPE, 6],
            "L1": [pygame.K_q, 4],
            "R1": [pygame.K_e, 5]
        }

        self.playSounds = 1
        self.playMusic = 1
        self.customCursor = 1

        #Start up animation
        self.startupImage = pygame.image.load(
            filePath.setPath(
                self.path,
                ["assets", "title screen", "logo.png"])).convert_alpha()
        self.startupImage = pygame.transform.scale(self.startupImage,
                                                   self.dimensions)
        self.startupRect = self.startupImage.get_rect()
        self.startupRect.center = (round(self.dimensions[0] / 2),
                                   round(self.dimensions[1] / 2))

        #Title screen
        self.background = pygame.image.load(
            filePath.setPath(
                self.path,
                ["assets", "title screen", "overlay.png"])).convert_alpha()
        self.background = pygame.transform.scale(self.background,
                                                 self.dimensions)

        self.cursor = pygame.image.load(
            filePath.setPath(self.path,
                             ["assets", "background", "cursor.png"]))
        self.cursor = pygame.transform.scale(self.cursor, (40, 40))

        self.cursorTouching = [None]

        self.instance = "main screen"  #Controls which UI is loaded

        self.savedData = self.loadSaves()

        #Calculations needed for graph coordinates
        boxSpace = self.dimensions[1] / 3 - 110
        boxShift = (boxSpace - 3 * 35) / 2 + self.dimensions[1] / 3 + 70
        boxShift2 = (boxSpace - 2 * 35) / 2 + self.dimensions[1] / 3 + 70
        #i*45+boxShift  #Box Widths = 168, 242, 119

        self.graph = {
            "NEW GAME": {
                "up":
                "CONFIG",
                "down":
                "LOAD",
                "value":
                (self.dimensions[0] - 200,
                 self.dimensions[1] - 4.6 * self.dimensions[1] / 20 + 5),
                "next":
                "Normal",
                "previous":
                ""
            },  #Controls where the controller should take the cursor
            "LOAD": {
                "up":
                "NEW GAME",
                "down":
                "CONFIG",
                "value":
                (self.dimensions[0] - 200,
                 self.dimensions[1] - 3.2 * self.dimensions[1] / 20 + 5),
                "next":
                "save1",
                "previous":
                ""
            },
            "CONFIG": {
                "up":
                "LOAD",
                "down":
                "NEW GAME",
                "value":
                (self.dimensions[0] - 200,
                 self.dimensions[1] - 1.8 * self.dimensions[1] / 20 + 5),
                "next":
                "Sound",
                "previous":
                ""
            },
            "Normal": {
                "up": "Extreme",
                "down": "Hard",
                "value": (self.dimensions[0] * 0.25 + 75, boxShift),
                "next": "save1",
                "previous": "NEW GAME"
            },
            "Hard": {
                "up": "Normal",
                "down": "Extreme",
                "value": (self.dimensions[0] * 0.25 + 75, 45 + boxShift),
                "next": "save1",
                "previous": "NEW GAME"
            },
            "Extreme": {
                "up": "Hard",
                "down": "Normal",
                "value": (self.dimensions[0] * 0.25 + 75, 90 + boxShift),
                "next": "save1",
                "previous": "NEW GAME"
            },
            "save1": {
                "up": "save6",
                "down": "save2",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.25),
                "next": "Yes",
                "previous": ""
            },
            "save2": {
                "up": "save1",
                "down": "save3",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.35),
                "next": "Yes",
                "previous": ""
            },
            "save3": {
                "up": "save2",
                "down": "save4",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.45),
                "next": "Yes",
                "previous": ""
            },
            "save4": {
                "up": "save3",
                "down": "save5",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.55),
                "next": "Yes",
                "previous": ""
            },
            "save5": {
                "up": "save4",
                "down": "save6",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.65),
                "next": "Yes",
                "previous": ""
            },
            "save6": {
                "up": "save5",
                "down": "save1",
                "value":
                (self.dimensions[0] * 0.12, self.dimensions[1] * 0.75),
                "next": "Yes",
                "previous": ""
            },
            "Sound": {
                "up": "Custom Cursor",
                "down": "Music",
                "value": (self.dimensions[0] * 0.25 + 112, boxShift),
                "next": "Sound",
                "previous": "CONFIG"
            },
            "Music": {
                "up": "Sound",
                "down": "Custom Cursor",
                "value": (self.dimensions[0] * 0.25 + 112, 45 + boxShift),
                "next": "Music",
                "previous": "CONFIG"
            },
            "Custom Cursor": {
                "up": "Music",
                "down": "Sound",
                "value": (self.dimensions[0] * 0.25 + 112, 90 + boxShift),
                "next": "Custom Cursor",
                "previous": "CONFIG"
            },
            "Yes": {
                "up": "No",
                "down": "No",
                "value": (self.dimensions[0] * 0.25 + 56.5, boxShift2),
                "next": "",
                "previous": ""
            },
            "No": {
                "up": "Yes",
                "down": "Yes",
                "value": (self.dimensions[0] * 0.25 + 56.5, 45 + boxShift2),
                "next": "",
                "previous": ""
            },
        }
        self.currentNode = "NEW GAME"

        #Gradients
        self.gradient = pygame.Surface(self.dimensions, pygame.SRCALPHA)
        optionsRect = (self.dimensions[0] * 0.4, self.dimensions[1] / 20
                       )  #Constant for ui sizes
        self.rectangleSurface = pygame.Surface(optionsRect, pygame.SRCALPHA)
        self.squareSurface = pygame.Surface((optionsRect[1], optionsRect[1]),
                                            pygame.SRCALPHA)
        self.highlightSurface = pygame.Surface(
            (optionsRect[1] * 0.6, optionsRect[1] * 0.6), pygame.SRCALPHA)
        self.lineSurface = pygame.Surface((self.dimensions[0] - 30, 3),
                                          pygame.SRCALPHA)
        self.uiBox = pygame.Surface(
            (self.dimensions[0], self.dimensions[1] / 3), pygame.SRCALPHA)
        self.uiBox.fill((0, 0, 0, 170))
        self.saveImage = pygame.Surface(
            (self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.SRCALPHA)
        self.saveImageLine = pygame.Surface((self.dimensions[0] * 0.8, 3),
                                            pygame.SRCALPHA)

        #draw main option pre-calculations
        self.yCalculations = [
            self.dimensions[1] - 1.8 * optionsRect[1],
            self.dimensions[1] - 3.2 * optionsRect[1],
            self.dimensions[1] - 4.6 * optionsRect[1]
        ]
        self.mainOptionCalculations = [
            ((self.dimensions[0] + 1 - optionsRect[0],
              self.yCalculations[0]), (30, self.yCalculations[0]),
             (30 + optionsRect[1] * 0.2,
              self.yCalculations[0] + optionsRect[1] * 0.2),
             (30, self.yCalculations[0] + optionsRect[1] - 3)),
            ((self.dimensions[0] + 1 - optionsRect[0],
              self.yCalculations[1]), (30, self.yCalculations[1]),
             (30 + optionsRect[1] * 0.2,
              self.yCalculations[1] + optionsRect[1] * 0.2),
             (30, self.yCalculations[1] + optionsRect[1] - 3)),
            ((self.dimensions[0] + 1 - optionsRect[0],
              self.yCalculations[2]), (30, self.yCalculations[2]),
             (30 + optionsRect[1] * 0.2,
              self.yCalculations[2] + optionsRect[1] * 0.2),
             (30, self.yCalculations[2] + optionsRect[1] - 3))
        ]

        #draw ui box pre-calculations
        self.uiBoxCalculations = [
            (0, self.dimensions[1] / 3),
            ((0, self.dimensions[1] / 3 - 5), (self.dimensions[0],
                                               self.dimensions[1] / 3 - 5)),
            ((0, 2 * self.dimensions[1] / 3), (self.dimensions[0],
                                               2 * self.dimensions[1] / 3)),
            (self.dimensions[0] / 2, 2 * self.dimensions[1] / 3 - 25),
            (self.dimensions[0] / 2, self.dimensions[1] / 3 + 30),
            self.dimensions[1] / 3 - 110,
            self.dimensions[1] / 3 + 70,
            self.dimensions[0] * 0.25,
        ]

        #load menu pre-calculations
        self.loadMenuCalculations = [
            pygame.Rect(self.dimensions[0] * 0.1, self.dimensions[1] * 0.2,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.6),
            self.dimensions[1] * 0.1,
            pygame.Rect(self.dimensions[0] * 0.1, self.dimensions[1] * 0.2,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.Rect(self.dimensions[0] * 0.1,
                        self.dimensions[1] * 0.2 + self.dimensions[1] * 0.1,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.Rect(self.dimensions[0] * 0.1,
                        self.dimensions[1] * 0.2 + self.dimensions[1] * 0.2,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.Rect(self.dimensions[0] * 0.1,
                        self.dimensions[1] * 0.2 + self.dimensions[1] * 0.3,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.Rect(self.dimensions[0] * 0.1,
                        self.dimensions[1] * 0.2 + self.dimensions[1] * 0.4,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
            pygame.Rect(self.dimensions[0] * 0.1,
                        self.dimensions[1] * 0.2 + self.dimensions[1] * 0.5,
                        self.dimensions[0] * 0.8, self.dimensions[1] * 0.1),
        ]

        self.loadMenuYCalculations = [
            self.dimensions[1] * 0.2,
            self.dimensions[1] * 0.2 + self.dimensions[1] * 0.1,
            self.dimensions[1] * 0.2 + self.dimensions[1] * 0.2,
            self.dimensions[1] * 0.2 + self.dimensions[1] * 0.3,
            self.dimensions[1] * 0.2 + self.dimensions[1] * 0.4,
            self.dimensions[1] * 0.2 + self.dimensions[1] * 0.5,
        ]

        self.stage = "startUp1"
        self.clock = 0
        self.closing = False
        self.open = True