Optimize sprawdz_zasieg

This commit is contained in:
s500512 2024-12-11 15:28:10 +01:00
parent 93f8fd98de
commit 97fdd46adf

View File

@ -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))