# Help in Maze AI (chasing)

**URL:** <https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323>\
**Category:** programming\
**Created:** [March 17, 2006, 4:23am UTC](https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323 "2006-03-17T04:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chapan](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@chapan](https://forum.kirupa.com/u/chapan)\
**Post date:** [March 17, 2006, 4:23am UTC](https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323/1 "2006-03-17T04:23:22Z")

</div>

ive post before about the game. kinda like pacman game. can anyone help me with the actionscript of the enemy? the enemy is only one and constantly chasing the user’s character through the maze.

> onClipEvent(enterFrame){

coll = “”;  
for(i =0; i\<32;i++){  
if (this.hitTest(“\_parent.dinding” + i)) {  
coll = “hitted”;  
\_x = oldx;  
\_y = oldy;  
} else {  
if(coll != “hitted”){  
coll = “not hit”;  
}  
}  
}

oldx = \_x;  
oldy =\_y;  
}

this is the script i used for the user’s character. the character’s movement is fine and i need help on the AI of the enemy. can anyone help ?

since i cant upload my fla due to the size, here is the fla link :  
[betatesting.fla](http://student.mmu.edu.my/~1031113112/betatesting.fla)

---

<div class="post-metadata">

**Author:** ![freeskier89](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@freeskier89](https://forum.kirupa.com/u/freeskier89)\
**Post date:** [March 18, 2006, 11:03pm UTC](https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323/2 "2006-03-18T23:03:51Z")

</div>

Can you send it in MX format?

---

<div class="post-metadata">

**Author:** ![chapan](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@chapan](https://forum.kirupa.com/u/chapan)\
**Post date:** [March 19, 2006, 6:25am UTC](https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323/3 "2006-03-19T06:25:06Z")

</div>

eh … i thougt, the latest one is in mx version? its not?

---

<div class="post-metadata">

**Author:** ![freeskier89](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@freeskier89](https://forum.kirupa.com/u/freeskier89)\
**Post date:** [March 19, 2006, 7:39am UTC](https://forum.kirupa.com/t/help-in-maze-ai-chasing/182323/4 "2006-03-19T07:39:28Z")

</div>

Well, I tried to open it with Flash MX (old I know ☹ ), and it threw an invalid filetype exception I believe.
