Optimize sprawdz_zasieg
This commit is contained in:
parent
93f8fd98de
commit
97fdd46adf
@ -63,10 +63,7 @@ class Plansza:
|
||||
|
||||
dystans = self.sprawdz_dystans(x1, y1, x2, y2)
|
||||
|
||||
if atakujacy.zasieg_ataku >= dystans:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return atakujacy.zasieg_ataku >= dystans
|
||||
|
||||
def sprawdz_dystans(self, x1, y1, x2, y2):
|
||||
dystans = math.sqrt(math.pow(math.fabs(x1 - x2), 2) + math.pow(math.fabs(y1 - y2), 2))
|
||||
|
Loading…
Reference in New Issue
Block a user