def kill(self): self.stop() try: self.bubber.dragons.remove(self) except ValueError: pass ActiveSprite.kill(self)
def kill(self): from monsters import Monster for s in self.take_with_me[:]: if isinstance(s, Monster) and s.alive: s.argh(self.poplist, onplace=1) del self.take_with_me[:] ActiveSprite.kill(self) if not self.watercells[None].alive: del self.watercells[None] for s in self.watercells.values(): if s.alive: s.in_charge() break
def kill(self): self.play(images.Snd.Pop) self.bubble.gen = [self.bubble.die(Bubble.exploding_bubbles)] self.pacman.latestposition[self.bubber] = self.x, self.y try: self.bubber.dragons.remove(self) except ValueError: pass try: self.pacman.pacs.remove(self) except ValueError: pass ActiveSprite.kill(self)
def kill(self): images.Snd.Pop.play(1.0, pad=0.0) images.Snd.Pop.play(1.0, pad=1.0) ico = images.sprget(Bubble.exploding_bubbles[0]) for i in range(11): s = ActiveSprite(ico, self.x + random.randrange(self.ico.w) - CELL, self.y + random.randrange(self.ico.h) - CELL) s.gen.append(s.die(Bubble.exploding_bubbles)) try: self.arkanoid.paddles.remove(self) except ValueError: pass ActiveSprite.kill(self)
def kill(self): try: BubPlayer.DragonList.remove(self) except ValueError: pass try: self.bubber.dragons.remove(self) except ValueError: pass ActiveSprite.kill(self) if self.hatsprite is not None: if self.hatsprite.alive: self.hatsprite.kill() self.hatsprite = None
def scoreboard(reset=0, inplace=0, compresslimittime=0): endgame = 1 if reset: for p in BubPlayer.PlayerList: if inplace: for s in p.letters.values(): if isinstance(s, ActiveSprite): s.kill() if len(p.letters) == 6: p.letters.clear() for key in p.letters: p.letters[key] = 2 brd = boards.curboard if not brd or not gamesrv.sprites_by_n: return lst = [] bubblesshown = {} plist = [] teamslist = [[], []] teamspoints = [0, 0] for p in BubPlayer.PlayerList: if p.isplaying(): if p.lives != 0: endgame = 0 else: if not p.keepalive: continue if p.keepalive < time.time(): p.reset() continue if BubPlayer.DisplayPoints is not None: points = BubPlayer.DisplayPoints(p) else: points = p.points if p.team == -1: plist.append((points, p, None)) else: teamslist[p.team].append((points, p)) teamspoints[p.team] += points teamslist[0].sort() teamslist[1].sort() plist.append((teamspoints[0], None, teamslist[0])) plist.append((teamspoints[1], None, teamslist[1])) plist.sort() x0 = boards.bwidth y0 = boards.bheight for score, p, t in plist: if p: if p.lives == 0: ico = images.sprget(GreenAndBlue.gameover[p.pn][0]) elif p.icons: if p.isplaying(): mode = 0 else: mode = 11 ico = BubPlayer.OverridePlayerIcon or p.icons[mode, -1] lst.append((x0 + 9 * CELL - ico.w, y0 - ico.h, ico)) #if boards.curboard.wastingplay is None: for l in range(6): name = bubbles.extend_name(l) if name in p.letters: x, y = x0 + l * (CELL - 1), y0 - 3 * CELL imglist = getattr(LetterBubbles, name) ico = images.sprget(imglist[1]) if gamesrv.game.End in (0, 1): s = p.letters[name] if (isinstance(s, ActiveSprite) and BubPlayer.FrameCounter <= s.timeout): s.move(x, y) bubblesshown[s] = 1 continue if s == 1: s = ActiveSprite(ico, x, y) s.setimages( s.cyclic([ imglist[0], imglist[1], imglist[2], imglist[1] ])) s.timeout = BubPlayer.FrameCounter + 500 p.letters[name] = s bubblesshown[s] = 1 continue lst.append((x, y, ico)) ## else: ## ico = images.sprget(Bonuses.blue_sugar) ## lst.append((x0+12, y0-3*CELL-8, ico)) ## xyiconumber(DigitsMisc.digits_white, x0-19, y0-3*CELL+5, ## p.bonbons, lst) xyiconumber(GreenAndBlue.digits[p.pn], x0 + 2, y0 - 18, score, lst) if p.lives is not None and p.lives > 0: xyiconumber(DigitsMisc.digits_white, x0 + 7 * CELL, y0 - 18, p.lives, lst, width=2) x = x0 + 13 * HALFCELL for ico in p.nameicons: x -= 7 lst.append((x, y0 - 35, ico)) y0 -= 7 * HALFCELL else: # Team for pscore, p in t: if p.lives == 0: ico = images.sprget(GreenAndBlue.gameover[p.pn][0]) elif p.icons: if p.isplaying(): mode = 0 else: mode = 11 ico = BubPlayer.OverridePlayerIcon or p.icons[mode, -1] lst.append((x0 + 9 * CELL - ico.w, y0 - ico.h, ico)) for l in range(6): name = bubbles.extend_name(l) if name in p.letters: x, y = x0 + l * (CELL - 1), y0 - 2 * CELL imglist = getattr(LetterBubbles, name) ico = images.sprget(imglist[1]) if gamesrv.game.End in (0, 1): s = p.letters[name] if (isinstance(s, ActiveSprite) and BubPlayer.FrameCounter <= s.timeout): s.move(x, y) bubblesshown[s] = 1 continue if s == 1: s = ActiveSprite(ico, x, y) s.setimages( s.cyclic([ imglist[0], imglist[1], imglist[2], imglist[1] ])) s.timeout = BubPlayer.FrameCounter + 500 p.letters[name] = s bubblesshown[s] = 1 continue lst.append((x, y, ico)) x = x0 + 13 * HALFCELL for ico in p.nameicons: x -= 7 lst.append((x, y0 - 19, ico)) y0 -= 4 * HALFCELL if t != []: xyiconumber(GreenAndBlue.digits[t[-1][1].pn], x0 + 2, y0 - 18, score, lst) ico = images.sprget(('hat', p.team, -1, 1)) lst.append((x0 + 9 * CELL - ico.w, y0 - ico.h + 16, ico)) y0 -= 5 * HALFCELL for p in BubPlayer.PlayerList: for name, s in p.letters.items(): if isinstance(s, ActiveSprite) and s not in bubblesshown: p.letters[name] = 2 s.kill() compressable = len(lst) #if BubPlayer.HighScoreColor is not None: # x = xyiconumber(GreenAndBlue.digits[BubPlayer.HighScoreColor], # x0+2*CELL, HALFCELL, BubPlayer.HighScore, lst) # ico = images.sprget(GreenAndBlue.players[BubPlayer.HighScoreColor][3]) # lst.append((x-5*HALFCELL, 1, ico)) if BubPlayer.LimitScoreColor is not None: xyiconumber(GreenAndBlue.digits[BubPlayer.LimitScoreColor], x0 + 2 * CELL, HALFCELL, BubPlayer.LimitScore, lst) if BubPlayer.LimitTime is not None: seconds = int(BubPlayer.LimitTime) xyiconumber(DigitsMisc.digits_white, x0 + 2 * CELL, HALFCELL, seconds // 60, lst, width=3) ico = images.sprget('colon') lst.append((x0 + 5 * CELL - 1, HALFCELL + 1, ico)) seconds = seconds % 60 ico = images.sprget(DigitsMisc.digits_white[seconds // 10]) lst.append((x0 + 6 * CELL, HALFCELL, ico)) ico = images.sprget(DigitsMisc.digits_white[seconds % 10]) lst.append((x0 + 6 * CELL + ico.w, HALFCELL, ico)) ymin = HALFCELL + ico.h elif compresslimittime: ico = images.sprget(DigitsMisc.digits_white[0]) ymin = HALFCELL + ico.h else: ymin = 0 if not brd.bonuslevel: if brd.num < 99: xyiconumber(DigitsMisc.digits_white, 2, 2, brd.num + 1, lst, width=2) else: xyiconumber(DigitsMisc.digits_white, 2, 2, brd.num + 1, lst, width=3) # compress the scoreboard vertically if it doesn't fit ymin += HALFCELL if y0 < ymin: factor = float(boards.bheight - ymin) / (boards.bheight - y0) shift = ymin - y0 * factor + 0.5 for i in range(compressable): x, y, ico = lst[i] lst[i] = x, int((y + ico.h) * factor + shift) - ico.h, ico brd.writesprites('scoreboard', lst) if gamesrv.game.End in (0, 1): gamesrv.game.End = endgame
def kill(self): self.unlist() ActiveSprite.kill(self)