コード例 #1
0
ファイル: main.py プロジェクト: noamRoditi/tower-defense
 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)
コード例 #2
0
ファイル: main.py プロジェクト: noamRoditi/tower-defense
 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)