Advertisement
IHATEMICROWAVEOVEN

tower defense shift click

Oct 30th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. elif pygame.key.get_pressed()[pygame.K_LSHIFT]:
  2. chosenTower = -1
  3. for i in range(len(towerHitboxes)):
  4. if towerHitboxes[i].collidepoint(mouse.get_pos()):
  5. chosenTower = i
  6. break
  7. if chosenTower>=0:
  8. curStats = towers[chosenTower]
  9. if len(towerStats[curStats['Name']])>=curStats['Level']+2:
  10. cost = towerStats[curStats['Name']][curStats['Level']+1]['Cost']
  11. if money>=cost:
  12. money -= cost
  13. curStats['Level'] += 1
  14. else:
  15. print("bro is poor")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement