# Help with Path Optimization (source included)

**URL:** <https://forum.kirupa.com/t/help-with-path-optimization-source-included/170447>\
**Category:** flash\
**Created:** [November 26, 2005, 4:27am UTC](https://forum.kirupa.com/t/help-with-path-optimization-source-included/170447 "2005-11-26T04:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logikal2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/logikal2/32/1143_2.png) [@logikal2](https://forum.kirupa.com/u/logikal2)\
**Post date:** [November 26, 2005, 4:27am UTC](https://forum.kirupa.com/t/help-with-path-optimization-source-included/170447/1 "2005-11-26T04:27:18Z")

</div>

Hey guys,

I’m hoping that one of you could help me… this is somewhat complicated, so whoever’s up to the challenge (source code is in Flash 8):

I’m currently making a simulation in which **a bug maneuvers around obstacles to an endpoint. Some obstables (water, etc) reduce the bug’s speed, while others (roads) increase it**. The endpoint is chosen by a mouse click on the map. To find the best point to move next, a dummy object called “seeker” hovers in a circle around the bug and gathers info about the surroundings (terrain type, direction, etc). Each point around the bug is given a rating, or “pheromone”, and the coordinate around the bug that has the best rating will become the bug’s new location. A lot of arrays are used to store X values, Y values, and some other stuff. However, for some reason, the code doesn’t seem to work. It pops up the “would you like to terminate the program?” debugger message after taking a while to run.

Take a look at the code; I tried to comment it a lot. If you have any questions, let me know and I’ll try to check back frequently…

This is a school project due next week, and I’m already sweating about it. PLEASE somebody help, thanks! :te:

~Matt
