mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-13 14:02:23 +02:00
deleted h(x) and changed cost
This commit is contained in:
@@ -103,17 +103,18 @@ func getCost(field):
|
|||||||
for i in grid.object_grid[field.x][field.y]:
|
for i in grid.object_grid[field.x][field.y]:
|
||||||
match i:
|
match i:
|
||||||
Grid.Kind.DAMAGE:
|
Grid.Kind.DAMAGE:
|
||||||
cost += 100
|
cost += 15
|
||||||
Grid.Kind.SLOW:
|
Grid.Kind.SLOW:
|
||||||
cost += 1
|
cost += 4
|
||||||
return cost
|
return cost
|
||||||
|
|
||||||
#return an heurestic of distance
|
#return an heurestic of distance
|
||||||
# curr - current position
|
# curr - current position
|
||||||
# targ - a target position
|
# targ - a target position
|
||||||
func h_fn(curr, target):
|
func h_fn(curr, target):
|
||||||
var h = min(target[0]-curr[0],target[1]-curr[1])
|
|
||||||
return 0
|
return 0
|
||||||
|
var h = min(target[0]-curr[0],target[1]-curr[1])
|
||||||
|
return h
|
||||||
|
|
||||||
# currCost - currentCost
|
# currCost - currentCost
|
||||||
# target - position of the field to move to
|
# target - position of the field to move to
|
||||||
|
|||||||
Reference in New Issue
Block a user