flash - AS2 Enemy 'sliding' off of each other -


what best way handle enemies 'sliding' off of each other , preventing them overlapping? used in 3d games. i'm not sure start, thoughts?

first, may make sense use existing library such box2d.

secondly, sliding problem caused hit testing code. more likely, wait 2 enemies hit each other, detect hittest, , move them little bit. sliding happens repeatedly hitting, moving back, moving forward, hitting, moving back, moving forward, hitting, moving back...

basic solution problem detect enemies going hit in next iteration, , avoid actual hit. need work out enemies going in next iteration, , check if, in next iteration, bounding boxes going intersect. if going intersect on next iteration, need handle 'hit'.

so basically, enemies never hit or overlap. prevent it.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -