torch, minion, ai attack

This commit is contained in:
Jonas Mucke
2020-04-20 00:04:25 +02:00
parent 6b6bfe4842
commit fc59452928
15 changed files with 285 additions and 65 deletions

View File

@@ -99,6 +99,8 @@ func get_nearest(position, kind):
for i in prio_grid[x][y]:
if(i == kind):
list.append([x, y])
if list.size() == 0:
return[-1,-1]
var dist = []
for field in list:
var tmp = sqrt(pow(position[0] - field[0], 2) + pow(position[1] - field[1], 2))