!!
This commit is contained in:
parent
be7dc157d5
commit
bf1ed7ebbf
@ -17,7 +17,6 @@ position = Vector2(497, 324)
|
||||
position = Vector2(248, 225)
|
||||
motion_mode = 0
|
||||
|
||||
|
||||
[node name="BatSpawnable2" parent="." instance=ExtResource("3_a1ucf")]
|
||||
position = Vector2(644, 251)
|
||||
motion_mode = 0
|
||||
|
@ -97,11 +97,13 @@ func processAI(objs):
|
||||
var vec: Vector2 = Vector2(0,0)
|
||||
var weight: int = 0
|
||||
for obj in objs:
|
||||
if !obj || !obj.isAlive:
|
||||
continue
|
||||
if position.distance_to(obj.position) > 10:
|
||||
weight = abs(obj.priority) * position.distance_to(obj.position)
|
||||
vec += weight * position.direction_to(obj.position)
|
||||
else:
|
||||
weight = obj.priority * position.distance_to(obj.position) * (maxhp / hp) * 100
|
||||
weight = obj.priority * position.distance_to(obj.position) * ((maxhp + 1) / hp)
|
||||
vec += weight * -position.direction_to(obj.position)
|
||||
|
||||
if vec.length() < 5 && objs.size() > 1:
|
||||
|
Loading…
Reference in New Issue
Block a user