def newTower(self, row, col, towerButton): if towerButton == "Green": tower = GreenTower(row, col, self.board, self.cellDim) self.money -= tower.cost elif towerButton == "Red": tower = RedTower(row, col, self.board, self.cellDim) self.money -= tower.cost elif towerButton == "Orange": tower = OrangeTower(row, col, self.board, self.cellDim) self.money -= tower.cost elif towerButton == "Purple": tower = PurpleTower(row, col, self.board, self.cellDim) self.money -= tower.cost else: tower = Tower(row, col, self.board, self.cellDim) self.towers.towerList.append(tower)
def createInitTowers(self): self.orangeTower = OrangeTower(0, 0, self.board, self.cellDim) self.redTower = RedTower(0, 0, self.board, self.cellDim) self.greenTower = GreenTower(0, 0, self.board, self.cellDim) self.purpleTower = PurpleTower(0, 0, self.board, self.cellDim)