i'm not sure how to make this happen... if an enemy_type explodes, i want every enemy within a certain radius to move away from the explosion a specific amount, say '10' for the sake of argument. i can't get my head around the math. this is a 2d on 3d game, by the way.
i have
if e\myexplode_pushesothers
for ee.enemy_type = each enemy_type
if dist2d(entityx(ee\piv,1),entityz(ee\piv,1),entityx(e\piv,1),entityz(e\piv,1)) < 5
move ee\piv 5 away from e\piv without turning him
endif
next
endif
it's that middle part i'm not sure on - do i maybe make a new pivot at the enemy to move, point it towards the explosion, turn it 180 degrees the other way, and translate to it, then remove the pivot? this seems to make sense. how do i do the translate to a spot?
ow my head hurts.
i have
if e\myexplode_pushesothers
for ee.enemy_type = each enemy_type
if dist2d(entityx(ee\piv,1),entityz(ee\piv,1),entityx(e\piv,1),entityz(e\piv,1)) < 5
move ee\piv 5 away from e\piv without turning him
endif
next
endif
it's that middle part i'm not sure on - do i maybe make a new pivot at the enemy to move, point it towards the explosion, turn it 180 degrees the other way, and translate to it, then remove the pivot? this seems to make sense. how do i do the translate to a spot?
ow my head hurts.