示例#1
0
文件: circl.py 项目: icomann/circl
    def __init__(self, mp, mode, time, playerlist, resp):
        self.ssys = mp
        self.mode = mode
        self.timeleft = time
        self.respawntime = resp
        self.playerlist = playerlist
        self.playerc = len(self.playerlist)
        self.itemset= set()
        self.missset = set()
        self.projset = set()
        self.mainrender = pygame.Surface((self.ssys.radius*2, self.ssys.radius*2)).convert()
        self.bg = pygame.Surface(self.mainrender.get_size()).convert()

        try:
            a = pygame.image.load(folder('sprites', 'maps', ssys.bgs), 'bg')
        except:
            a = pygame.image.load(folder('sprites', 'maps', "default.png"),'bg')

        a.convert()
        self.bg.fill((20,20,60))
        self.bg.blit(a, (0,0))
        del a

        for plan in self.ssys.planets:
            pygame.draw.circle(self.bg, (min(255, plan.force/8),50,50+max(0, 120-plan.force/4)), plan.vPos.tup(), plan.fradius, 5+plan.force/70)
        for plan in self.ssys.planets:
            pygame.draw.circle(self.bg, plan.color, plan.vPos.tup(), plan.radius)

        self.mainrender.blit(self.bg, (0,0))

        p = 0
        for player in self.playerlist:
            player.pov = pygame.Surface((config.grw/self.playerc, config.grh))
            player.povpos = (p*config.grw/self.playerc, 0)
            p += 1
示例#2
0
文件: sprite.py 项目: icomann/circl
def load(filename, typee='no'):
    try:
        texture = pygame.image.load(folder('sprites', filename)).convert(renderer)
	texture.set_colorkey((255,0,255))
        texture.convert()
        if typee != 'no':
            texture = pygame.transform.scale(texture, size[typee])
    except:
        return None
    return texture 
示例#3
0
文件: mapinfo.py 项目: icomann/circl
            line = line.strip()
            if line[0] == ':':
                if line[1] == 'r':
                    self.radius = int(line[2:])
                elif line[1] == 'p':
                    self.pl = tuple(map(int,line[2:].split(',')))
                elif line[1] == 'a':
                    self.author = line[2:]
                elif line[1] == 't':
                    self.title = line[2:]
                continue
        ## planet: [((x,y), radius, force, (randomdropinfo), color/text), ...] hopeigettoletyouknow
        ##randdrinf: (((nuthin, 40), (ubergun,10), (candy,50)), period)        beforetheylockmesillyarseaway
            line = line.split(';')
            self.planets.append(planet(line, self.radius))
    def __str__(self):
        line = 'Sistema ' + self.title + '.\n'
        line += 'Made by ' + self.author + ' for ' + str(self.pl[0])
        line += ' to ' + str(self.pl[1]) + ' players.\n'
        line += '\nContains ' + str(len(self.planets)) + ' planets in a '
        line += str(self.radius) + ' radius:\n\n'
        line += 'POS\t\tSize\tSpawner\tGrav\n'
        for plan in self.planets:
            line += str(plan.vPos).ljust(16) + '\t'.join(map(str, [plan.radius, plan.spawn, plan.force])) + '\n'
        return line

ssyslist = list()
maplist = listdir(folder('maps'))
for lvl in maplist:
    ssyslist.append(ssyst(folder('maps', lvl)))
示例#4
0
文件: locale.py 项目: icomann/circl
    "bullet",
    "dakka",
    "generic",
    "gibs",
    "laser",
    "nuke",
    "overkill",
    "quick",
    "short",
    "space",
    "spree",
    "track",
]
for kfile in killtype:
    killnot[kfile] = set()
    kf = open(folder("locale", "kills", kfile))
    store = set()
    if kfile == "spree":
        killnot[kfile] = list()
        for line in kf:
            line = line.strip()
            if line == "" or line == " ":
                continue
            elif line[0] == "-":
                killnot[kfile].append(store)
                store = set()
                continue
            store.add(line)
    for line in kf:
        line = line.strip()
        if line == "" or line == " ":