Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update archerTower.py #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions towers/archerTower.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import math
from menu.menu import Menu


menu_bg = pygame.transform.scale(pygame.image.load(os.path.join("game_assets", "menu.png")).convert_alpha(), (120, 70))
upgrade_btn = pygame.transform.scale(pygame.image.load(os.path.join("game_assets", "upgrade.png")).convert_alpha(), (50, 50))


tower_imgs1 = []
archer_imgs1 = []
# load archer tower images
Expand All @@ -22,7 +20,6 @@
archer_imgs1.append(
pygame.image.load(os.path.join("game_assets/archer_towers/archer_top", str(x) + ".png")).convert_alpha())


class ArcherTowerLong(Tower):
def __init__(self, x,y):
super().__init__(x, y)
Expand All @@ -38,7 +35,6 @@ def __init__(self, x,y):
self.width = self.height = 90
self.moving = False
self.name = "archer"

self.menu = Menu(self, self.x, self.y, menu_bg, [2000, 5000,"MAX"])
self.menu.add_btn(upgrade_btn, "Upgrade")

Expand Down Expand Up @@ -117,22 +113,20 @@ def attack(self, enemies):
self.archer_imgs[x] = pygame.transform.flip(img, True, False)

return money



tower_imgs = []
archer_imgs = []
# load archer tower images
for x in range(10,13):
tower_imgs.append(pygame.transform.scale(
pygame.image.load(os.path.join("game_assets/archer_towers/archer_2", str(x) + ".png")),
(90, 90)))

# load archer images
for x in range(43,49):
archer_imgs.append(
pygame.image.load(os.path.join("game_assets/archer_towers/archer_top_2", str(x) + ".png")))


class ArcherTowerShort(ArcherTowerLong):
def __init__(self, x,y):
super().__init__(x, y)
Expand All @@ -145,10 +139,6 @@ def __init__(self, x,y):
self.left = True
self.damage = 2
self.original_damage = self.damage

self.menu = Menu(self, self.x, self.y, menu_bg, [2500, 5500, "MAX"])
self.menu.add_btn(upgrade_btn, "Upgrade")
self.name = "archer2"