# Basic AI

**URL:** <https://forum.kirupa.com/t/basic-ai/60548>\
**Category:** programming\
**Created:** [August 10, 2004, 5:42pm UTC](https://forum.kirupa.com/t/basic-ai/60548 "2004-08-10T17:42:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerek](https://avatars.discourse-cdn.com/v4/letter/k/b9bd4f/32.png) [@kerek](https://forum.kirupa.com/u/kerek)\
**Post date:** [August 10, 2004, 5:42pm UTC](https://forum.kirupa.com/t/basic-ai/60548/1 "2004-08-10T17:42:19Z")

</div>

What’s the best way to program basic AI into an enemy??

Say we want an enemy to walk back and forth protecting an entrance until the hero is within eyes view. Then that enemy would charge at the hero and try to attack randomly.

What would be the best way to do this? (Any other AI tips too please)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 10, 2004, 6:18pm UTC](https://forum.kirupa.com/t/basic-ai/60548/2 "2004-08-10T18:18:06Z")

</div>

Hey Kerek, the only AI I know, is fighting AI. but _this_ guy is awsome at the AI programming!  
[http://www.kirupaforum.com/forums/showthread.php?t=16649](http://www.kirupaforum.com/forums/showthread.php?t=16649)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 11, 2004, 3:16am UTC](https://forum.kirupa.com/t/basic-ai/60548/3 "2004-08-11T03:16:05Z")

</div>

> [@elPooter](#):
>
> Hey Kerek, the only AI I know, is fighting AI. but _this_ guy is awsome at the AI programming!  
> [http://www.kirupaforum.com/forums/showthread.php?t=16649](http://www.kirupaforum.com/forums/showthread.php?t=16649)

niiiiiiice :D! very neat stuff!
