|
|
@ -1,4 +1,5 @@ |
|
|
|
import pygame |
|
|
|
from classes.svg import Svg |
|
|
|
from classes.towers.tower import Tower |
|
|
|
from classes.settings import Settings |
|
|
|
from classes.towers.projectiles.bubble import Bubble |
|
|
@ -8,19 +9,11 @@ class Bubbler(Tower): |
|
|
|
def __init__(self, gridPos): |
|
|
|
settings = Settings() |
|
|
|
|
|
|
|
# Make a surface |
|
|
|
surface = pygame.Surface( |
|
|
|
(settings.gridSize, settings.gridSize), |
|
|
|
pygame.SRCALPHA |
|
|
|
) |
|
|
|
# Convert SVG to PNG and return filename |
|
|
|
pngFile = Svg().svgAsPng('images/bubbler.svg', (10, 10)) |
|
|
|
|
|
|
|
# And fill it with a square the same size. |
|
|
|
pygame.draw.rect( |
|
|
|
surface, |
|
|
|
(0, 0, 255), |
|
|
|
surface.get_rect(), |
|
|
|
0 |
|
|
|
) |
|
|
|
# Import bubble image |
|
|
|
surface = pygame.image.load(pngFile) |
|
|
|
|
|
|
|
# Call the generic Tower constructor |
|
|
|
super(self.__class__, self).__init__( |
|
|
|