# AI for maze game

**URL:** https://forum.kirupa.com/t/ai-for-maze-game/74380
**Category:** programming
**Created:** [December 28, 2004, 5:00pm UTC](https://forum.kirupa.com/t/ai-for-maze-game/74380 "2004-12-28T17:00:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![meandmymachine](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@meandmymachine](https://forum.kirupa.com/u/meandmymachine)
#### Post date: [December 28, 2004, 5:00pm UTC](https://forum.kirupa.com/t/ai-for-maze-game/74380/1 "2004-12-28T17:00:24Z")

</div>

Hello

I’m building a 2D maze game in Flash featuring “smart” enemies but I’m having trouble writing the AI efficiently (i.e. with less code).

Presently, I’ve got a load of conditional if statements based on timer values. Everything works (just about) so far but I know it’s going to result in a complete mess if I carry on with this method. I’m sure theres a more efficient way to do this but I can’t work it out. Can anyone help?

I can e-mail the relevant file to anyone who is interested. Many thanks in advance.
