def hitShips(self, ship1, ship2): if OdeUtil.areConnected(ship1.body, self.body): self.setPos( Vec3(random.randrange(30), random.randrange(40), 0)) self.PowerUpEffect(ship1) #self.body.disable() #self.visualNode.hide() elif OdeUtil.areConnected(ship2.body, self.body): self.setPos( Vec3(random.randrange(30), random.randrange(40), 0)) self.PowerUpEffect(ship2)
def hitShips(self, shipList): for ship in shipList: #get boundaries from somewhere and put the randrange to those if OdeUtil.areConnected(ship.body, self.body): self.setPos( Vec3(random.randrange(30), random.randrange(40), 0)) self.PowerUpEffect(ship)
def hitShips(self, shipList): for ship in shipList: #get boundaries from somewhere and put the randrange to those if OdeUtil.areConnected(ship.body, self.body) and not ship.hasBall(): self.PowerUpEffect(ship)
def shipsCollide(self, enemy): if OdeUtil.areConnected(self.body, enemy.body): highest = max(self.getVelocity()) eneHighest = max(enemy.getVelocity()) if highest > eneHighest: enemy.releaseBall() else: self.releaseBall() self.game.shakeCam() self.game.collisionSfx.play()
def hitShips(self, shipList): for ship in shipList: if OdeUtil.areConnected(ship.body, self.body) and not ship.hasBall(): self.PowerUpEffect(ship)