Tests examples for the miniworldmaker engine https://www.miniworldmaker.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
miniworldmaker_cookbook/snippets/2 Movement/229_distance_pixel_board.py

11 lines
268 B

from miniworldmaker import *
board = Board(8,8)
t = Token(0,0)
t2 = Token(201, 201)
pos = t2.center
print(t.get_distance_to(t2))
print(t.get_distance_to(pos))
assert t.get_distance_to(t2) == t.get_distance_to(pos)
assert 284 < t.get_distance_to(pos) < 285
board.run()