re-named variables for increased accuracy
This commit is contained in:
@@ -617,23 +617,25 @@ class Tile(object):
|
|||||||
depth = len(path)
|
depth = len(path)
|
||||||
|
|
||||||
# Radius of the world in chunk cols/rows
|
# Radius of the world in chunk cols/rows
|
||||||
|
# (Diameter in X is 2**depth, divided by 2 for a radius, multiplied by
|
||||||
|
# 2 for 2 chunks per tile. Similarly for Y)
|
||||||
xradius = 2**depth
|
xradius = 2**depth
|
||||||
yradius = 2*2**depth
|
yradius = 2*2**depth
|
||||||
|
|
||||||
x = -xradius
|
col = -xradius
|
||||||
y = -yradius
|
row = -yradius
|
||||||
xsize = xradius
|
xsize = xradius
|
||||||
ysize = yradius
|
ysize = yradius
|
||||||
|
|
||||||
for p in path:
|
for p in path:
|
||||||
if p in (1,3):
|
if p in (1,3):
|
||||||
x += xsize
|
col += xsize
|
||||||
if p in (2,3):
|
if p in (2,3):
|
||||||
y += ysize
|
row += ysize
|
||||||
xsize //= 2
|
xsize //= 2
|
||||||
ysize //= 2
|
ysize //= 2
|
||||||
|
|
||||||
return cls(x, y, path)
|
return cls(col, row, path)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def compute_path(cls, col, row, depth):
|
def compute_path(cls, col, row, depth):
|
||||||
|
|||||||
Reference in New Issue
Block a user