def init(self): """ Starts/Resets the game to its inital state """ self.creep_counts = {"GOOD": 0, "BAD": 0} if self.player is None: self.player = Player( self.AGENT_RADIUS, self.AGENT_COLOR, self.AGENT_SPEED, self.AGENT_INIT_POS, self.width, self.height ) else: self.player.pos = vec2d(self.AGENT_INIT_POS) self.player.vel = vec2d((0.0, 0.0)) if self.creeps is None: self.creeps = pygame.sprite.Group() else: self.creeps.empty() for i in range(self.N_CREEPS): self._add_creep() self.score = 0 self.ticks = 0 self.lives = -1
def init(self): """ Starts/Resets the game to its inital state """ self.player = Player(self.AGENT_RADIUS, self.AGENT_COLOR, self.AGENT_SPEED, self.AGENT_INIT_POS, self.width, self.height) self.player_group = pygame.sprite.Group() self.player_group.add(self.player) self.good_creep = Creep(self.CREEP_GOOD['color'], self.CREEP_GOOD['radius'], self._rngCreepPos(), (1, 1), 0.0, 1.0, "GOOD", self.width, self.height) self.bad_creep = PuckCreep((self.width, self.height), self.CREEP_BAD, self.screen_dim[0] * 0.75, self.screen_dim[1] * 0.75) self.creeps = pygame.sprite.Group() self.creeps.add(self.good_creep) self.creeps.add(self.bad_creep) self.score = 0 self.ticks = 0 self.lives = -1
def init(self): """ Starts/Resets the game to its inital state """ self.creep_counts = { "GOOD":0, "BAD":0 } self.player = Player(self.AGENT_RADIUS, self.AGENT_COLOR, self.AGENT_SPEED, self.AGENT_INIT_POS, self.width, self.height) self.player_group = pygame.sprite.Group() self.player_group.add( self.player ) self.creeps = pygame.sprite.Group() for i in range(self.N_CREEPS): self._add_creep() self.score = 0 self.ticks = 0 self.lives = -1