-
Notifications
You must be signed in to change notification settings - Fork 0
/
armory.py
44 lines (21 loc) · 1.07 KB
/
armory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'''
Created on Oct 23, 2010
@author: lucas
'''
from Building import Building
from Constants import *
class Armory(Building):
def __init__(self, x, y, terrain, life, lifeRegenerationRate, team, image_path):
Building.__init__(self, x, y, terrain, life, lifeRegenerationRate, team, image_path)
def damage(self, value):
self.currentLife -= value
if(self.currentLife < 0):
self.currentLife = False
def process(self, terrain, population):
if(self.currentLife < self.maxLife):
self.currentLife += self.lifeRegenerationRate
else:
self.currentLife = self.maxLife
def paint(self, screen, translation):
if(self.alive):
screen.blit(self.image, (SQUARE_SIZE*self.x + translation[0], SQUARE_SIZE*self.y + translation[1]))