def __addBauble(self, player, force=False): logging.info("Add Bauble (%s) for Player %d", repr(force), player.netid) # add player bauble b = Bauble(getPositionAwayFromOtherObjects(self.world, 80, 30, force), self.__points_gold) self.__baubles[player.netid] = b self.world.append(b) logging.info("Done Adding Bauble")
def __addBaubles(self, w, num, force=False): logging.info("Adding %d Baubles (%s)", num, repr(force)) for i in xrange(num): r = random.random() v = 0 for ent in self.__valuetable: if r < ent[0]: v = ent[1] break b = Bauble(getPositionAwayFromOtherObjects(w, 80, 30, force), v) if v == self._mv: self.__baubles[b.id] = b w.append(b) logging.info("Done Adding Baubles")
def addBubbles(self, w, num, setpoints=None, pos=None, pname=None, force=False): logging.info("Adding %d Bubbles (%s)", num, repr(force)) for i in xrange(num): points = random.randint(self.__sizemin, self.__sizemax) if setpoints != None: points = setpoints if pos == None: npos = getPositionAwayFromOtherObjects(w, 100, 30, force) else: npos = pos bt = self.__bubbletime if bt > 0: bt += random.randint(0, self.__bubbletimevar) if hasattr(self, "world"): # NOTE: This doesn't follow the paradigm, but we need the latest reference to the world as this gets screwed up resetting the world... b = Bubble(npos, self.__sizebase, points, self.__pointspeed, bt, pname, self.world, self) else: b = Bubble(npos, self.__sizebase, points, self.__pointspeed, bt, pname, w, self) # this should only be the case for the initial world # The Whole Lifecycle of the Game and Rounds needs to be redefined for V2 w.append(b) self.__bubbles[b.id] = b logging.info("Done Adding Bubbles")
def __addAsteroids(self, w, num, force=False): logging.info("Adding %d Asteroids (%s)", num, repr(force)) for i in xrange(num): w.append(Asteroid(getPositionAwayFromOtherObjects(w, 100, 30, force))) logging.info("Done Adding Asteroids")
def __addAsteroid(self, force=False): logging.info("Add Asteroid (%s)", repr(force)) # add player bauble self.world.append(Asteroid(getPositionAwayFromOtherObjects(self.world, 80, 30, force))) logging.info("Done Adding Asteroid")
def __addBaubles(self, w, num, force=False): logging.info("Adding %d Baubles (%s)", num, repr(force)) for i in xrange(num): w.append(Bauble(getPositionAwayFromOtherObjects(w, 100, 30, force), self.__points_blue)) logging.info("Done Adding Baubles")