예제 #1
0
def saveObjects(sectornum, save_list, width, height):
    _processListForSave(save_list, width, height)
    
    resave_list = filehelper.loadObj(6)
    resave_list[sectornum-1] = save_list

    filehelper.saveObj(resave_list, 6)
예제 #2
0
def getObjects(sectornum, width, height):
    object_list = filehelper.loadObj(6)[sectornum-1]

    if object_list == [-1]:
        object_list = ["PLEASE GENERATE"]
    if len(object_list) > 1:
        if sectorGeneration(sectornum) and object_list[4] not in [1,5]:
           object_list = ["PLEASE GENERATE"] 
                    
    if object_list != ["PLEASE GENERATE"]:
        _processListFromSave(object_list, width, height)
        for i in range(int(len(object_list)/8)):
            if object_list[4+i*8] == 2 or object_list[4+i*8] == 8:
                object_list[7+i*8] = -10 #gets rid of shots and alien shots when entering a sector
    return object_list