Browse Source

Change sizes and speeds to be based on gridSize

master
Elis Axelsson 4 years ago
parent
commit
9e8c739353
  1. 14
      classes/enemies/ogre.py
  2. 4
      classes/towers/bubbler.py

14
classes/enemies/ogre.py

@ -1,12 +1,18 @@
import pygame
from classes.settings import Settings
from classes.enemies.enemy import Enemy
class Ogre(Enemy):
def __init__(self, gridPos):
settings = Settings()
# One quarter grid size
one_quarter = round(settings.gridSize / 4)
# Make a surface
surface = pygame.Surface(
(30, 30),
(one_quarter * 3, one_quarter * 3),
pygame.SRCALPHA
)
@ -14,8 +20,8 @@ class Ogre(Enemy):
pygame.draw.circle(
surface,
(0, 255, 0),
(15, 15),
15,
(round(one_quarter * 1.5), round(one_quarter * 1.5)),
round(one_quarter * 1.5),
0
)
@ -24,5 +30,5 @@ class Ogre(Enemy):
gridPos=gridPos,
surface=surface,
health=200,
speed=20,
speed=settings.gridSize * 2.5,
)

4
classes/towers/bubbler.py

@ -26,8 +26,8 @@ class Bubbler(Tower):
super(self.__class__, self).__init__(
fireRate=250,
damage=10,
range=300,
speed=100,
range=settings.gridSize * 8,
speed=settings.gridSize * 2.5,
surface=surface,
gridPos=gridPos,
projectile=Bubble,

Loading…
Cancel
Save